Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging (java.util.logging)

 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic