This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2SE Logging - setting the log level of all children loggers

 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I am trying to set the log level of all loggers that start with say, 'com.foo' by setting it in logging.properties file.
But when I create a logger for 'com.foo.bar' , it still gets assigned the default logging level of INFO.

On the other hand, if I set the default log level using
.level= FINER
Then it works fine.

Am I missing something here? Cant I change the log level of all children of 'com.foo' at one place?

Thanks.

Sonny

[ August 24, 2004: Message edited by: Sonny Gill ]
[ August 26, 2004: Message edited by: Sonny Gill ]
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make it a bit more specific,



The above code prints

null
Parent - FINE
INFO: info

Now if the level for logger is null, shouldnt it inherit the level from its parent which is set to Logger.FINE?

But it is not logging the String passed in logger.fine("fine"), why?

Sonny

Should this thread by in the 'Intermediate Java' forum instead of here, since logging is part of J2SE now!
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally figured it out!!

Had to change the level of the console handler, which is the set to INFO by default in logging.properties
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic