Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "Logging_Tutorial" page has been changed by GlenIhrig:
http://wiki.apache.org/tomcat/Logging_Tutorial?action=diff&rev1=8&rev2=9

Comment:
Added clarification on the definition of 'myLogger'

  is called, it will get logged because the level
  intrinsic to the method severe is greater than 3.  So you are following this, 
but wondering
  how myLogger's level got set to 3 (INFO), since we never explicitly set it.  
The answer
- is that it comes from the root Logger.  Now suppose you created logger named 
'com.example.myapp'
+ is that it comes from the root Logger.  
+ 
- and set its level.  Would myLogger still get its level from the root Logger.  
It would not.
+ Now suppose you created a logger named 'com.example.myapp' and set its level. 
 Would myLogger still get its level from the root Logger.  It would not.
+ 
  The reason is that the logger named 'com.example.myapp' is now a parent 
logger to myLogger,
  and myLogger gets its level from it instead.  How did the 'com.example.myapp' 
Logger
- become a parent?
- It's because of its name 'com.example.myapp'.  If it were named 
'org.charity.generous', it
+ become a parent? It's because of its name 'com.example.myapp'.  If it were 
named 'org.charity.generous', it
+ would not be a parent logger.  Do you see the pattern (myLogger = 
Logger.getLogger('com.example.myapp.CriticalComponent') includes 
'com.example.myapp' in its name)?  
- would not be a parent logger.  Do you see the pattern (myLogger includes 
'com.example.myapp'
- in its name)?  
  
  Now that we mulled that over you have an idea of what a level is as well.  
The Level
  determines what gets logged.  You can set the level directly on myLogger like 
this:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to