File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Logging (java.util.logging) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Logging (java.util.logging)" Watch "Logging (java.util.logging)" New topic
Author

Logging (java.util.logging)

Javini Javono
Ranch Hand

Joined: Dec 03, 2003
Posts: 286
Hi,
Given the following code:

I run the above program with this command:

and get this result:

The output does not match my expectations; for I would
have though to also see the following lines:

Am I using the logging facility incorrectly?
{I'm running Java 1.4 on Mac OS X; I do not use
any configuration files or anything that is not
already shown above}.
Thanks,
Javini Javono
[ May 08, 2004: Message edited by: Javini Javono ]
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Javini,
Am I using the logging facility incorrectly?

Not at all. Except that the logging Handlers have their own level too. Your default handler (a ConsoleHandler) has its level set to INFO by default, meaning that while your Logger effectively logs messages at the finest level, your handler only "handles" those which have a level of INFO or above.
Regards,
Phil.
Javini Javono
Ranch Hand

Joined: Dec 03, 2003
Posts: 286
Hi,
Thanks for your hint Phil. I'll search for a software solution
to get all the levels to print to the console.
Thanks,
Javini Javono
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Javini,
If you didn't set up other handlers, you probably can (I write this from memory) set the level of your default ConsoleHandler to FINEST by calling:

Anyway, if that line didn't work as excepted, you got the idea.
Regards,
Phil.
Javini Javono
Ranch Hand

Joined: Dec 03, 2003
Posts: 286
Hi,
Thanks much Phil. I was hoping for a software solution not using
configuration files; here is the first attempt:

With these results:

Thanks
Javini Javono
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging (java.util.logging)