public class Foo
implements Runnable
{
protected final String name;
protected final Marker marker;
protected final Logger log = LoggerFactory.getLogger(getClass());
public Foo(String name)
{
this.name = name;
marker = MarkerFactory.getMarker(name);
}
public void run()
{
while (true)
{
...
log.debug(marker, "some stuff");
...
}
}
}
new Thread(new Foo("A")).start();
new Thread(new Foo("B")).start();
So you could see the logs for each Foo ('A' and 'B')...
Also, can Markers be created on the fly by using MarkerFactory.getMarker()? Or
does that Marker have to exist in a config file somewhere... (e.g. what does
LogBack do?)
Thanks,
Michael
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ceki Gülcü
Sent: Wednesday, February 07, 2007 3:14 PM
To: [email protected]
Subject: Re: [slf4j-user] Marker for object identification?
Hi Michael,
I don't fully understand your question. However, you can use a marker to color
a log request so that it triggers some particular treatment. Does this help?
At 09:10 PM 2/7/2007, Newcomb, Michael-P57487 wrote:
>Can/Should markers be used to identify specific objects? The only
>example I see is for use with the 'TRACE' marker, but was wondering if
>markers could/should be used object identification as well.
>
>Thanks,
>Michael
>_______________________________________________
>user mailing list
>[email protected]
>http://www.slf4j.org/mailman/listinfo/user
--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user