SLF4J Java Logging Design -


i beginning use slf4j logging , first thing strikes me following piece of code

public class myclass {    private static final logger = org.slf4j.loggerfactory.getlogger(myclass.class) } 

what design principle or logic of using class argument obtain instance of logger ?

the result of each logging statement generated logger contains name of class. want to:

  1. identify source of logging message in output
  2. filter on messages. can enable disable messages class and/or containing package. e.g. may wish disable dao package messages (for whatever reason)

the above common pattern in logging. note don't have provide class, can provide own string instead, , arbitrarily categorise messages yourself.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -