On Jun 30, 2005, at 9:24 PM, Oleg wrote:
I use Tomcat 5.0.28 server, right after startup JProfiler reports
about
75 instances of org.apache.log4j.Logger running. All my servlets get
logger like so:
private static Logger log = Logger.getLogger(ClassName.class);
I was under impressions that there will be a single insance of
Logger for
all classes, why there so many instances?
With the pattern your are describing, there will be one logger for
each class, but all instances of a class would share a pointer to the
same logger. If you want to only have one logger in the application,
then you'd have to use the same string or class in the argument to
all calls to getLogger(). If you have 75 distinct classes with a
static Logger member, then you'd typically have 75 instances of
Logger in the Hierarchy.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]