logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Krieg <akr...@marketaxess.com>
Subject Centralized Logging class and the State of Log4J
Date Mon, 18 Feb 2002 20:55:37 GMT
I'm considering using Log4J for a new project, but have some questions about
it that I need to be answered before I make my decision.  I'm interested in
having a single logging class that client classes can call just by writing:

MyLogger.debug(this,"log statement");

I'm passing in a reference to the object in order to keep track of who's
calling the logger, so that the logger can print out that info, if needed.
There will be one configuration for the whole application, which will get
set in this MyLogger class.  But in reading the documentation, it seems that
every class that wants to use the logger has to get an instance of
Category/Logger along the ways of

static Category = Category.getInstance("MyClassName");  ?

If so, that will be a pain when Category gets thrown out the window in a
year.  I'll have to change Category.getInstance to Logger.getLogger all over
the place and use Level instead of Priority and a whole bunch of other
stuff.  I would like to wrap up all this log4J API specific stuff in one
class so when 2003 rolls around, I'm not in global search and replace mode
all over my code.  

This brings me to my second question.  I would use version 1.2, but was put
off by the statement:Log4j version 1.2 is not feature-complete, nor is the
documentation up to date, so I hesitated to use it.  On the other hand it is
obvious that changes on a very fundamental level (Priority vs Level,
Category vs Logger) are occurring going from 1.1 to 1.2, so what is a
developer to do?  What is everybody else doing with this?

Thanks in advance,
Adam


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message