• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java logging in JApplet

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to use java logging API in applet, i want to
use ConsoleHandler to get all the logs in my java
console, also i want to have a JDialog where i will
display various logging level options and then set the
log level from the selected option.
I dont want to use a properties file to set Log level,

how will i get it working if my package name is
"com.test.applet" and all the applet classes are
inside this package

Ashish
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the Java Logging API supports both loading configuration from arbitrary sources (i.e. a class, a database) as well as dynamic configuration. Take a look at the Java Logging Overview for examples.
 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
thanx, does any one have a working sample to set loglevel from a class and not from properties file, also security manager does not allow to set loglevel on ConsoleHandle in JApplet if it is not a secured applet

Ashish
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you happen to read the Java Logging Overview I pointed you to? Particularly the section marked "2.2 Changing the Configuration". That says "Here's a small program that dynamically adjusts the logging configuration. . ."
 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
thanx for the direction, i did read the document and tried that code, it will not work in applet unless i make the applet trusted because of security reasons. I have to use getAnonymousLogger() in applet if it is not trusted, and dont know if i can setup log level for this logger in one class and can use the same log level in other class also,
for example
in my class A i define
Logger logger = Logger.getAnonymousLogger();
and set the logger leverl to ALL
then in class B if i again define
Logger log = Logger.getAnonymousLogger();
then what will be the log level, will it All or just info.
have to test this in program
Ashish
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic