Hello Maciej,

first I think this should go to the users list, dev is for log4j development 
itself.
-------- Original-Nachricht --------
Datum: Wed, 13 Sep 2006 10:27:52 +0200
Von: Maciej Gawinecki <[EMAIL PROTECTED]>
An: log4j-dev@logging.apache.org
Betreff: static logger and instances with names

> I'm developing distributed application with of 5 agents, where 2 agents
> are instances of class X and 3 agents - of class Y. Each agent has
> unique name. I would like, that loggers contained reported also the
> names of agents, but there, in fact, loggers are static and thus
> associated with classes, not instances.
> 
> Has anyone of you meet similar approach ?
Static Loggers (independent from the library or logging wrapper) are a problem, 
have a look at:
http://wiki.apache.org/jakarta-commons/Logging/StaticLog

You could have something like this:

public class Y {

private Logger log;

public Y(final String instancename) {
 this.log = Logger.getLogger(instancename);
}
}

Regards
Boris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to