[slf4j-dev] Usage of Markers

Ralph Goers rgoers at apache.org
Fri Jun 5 15:32:26 CEST 2009


On Jun 4, 2009, at 7:37 AM, Szel, Zoltan wrote:

> > The issue is in what the benefit is in having Markers for each of  
> the various kinds of alerts
> There would be only one Marker implementation which would contain  
> any information required(alertkey, level1/level2 classification etc)  
> to send an alert. This would allow the flexibility to send different  
> alerts with the same API(they can provide defaults, but it would not  
> be enough given that different infrastructure components will send  
> alerts with different properties).
>
> >If you check out the SLF4J extensions you will find an EventLogger  
> class that is meant to do this kind of >thing. It uses a Marker to  
> categorize the log record as an Event. It then uses a companion  
> EventData class to >capture the specific data related to the event.
> I have checked it out and what I have found is that the EventData is  
> simply logged as an xml via an SLF4J logger. This is insufficient  
> for me because the companion data needs to be available in the  
> appender itself, because he is the only one who knows how to  
> interpret  them.

Yes, the appender needs the data. In the Appender just do
EventData data = new EventData(event.getMessage());

You then have access to all your event data. It is not a big deal and  
is much better than making a Marker a heavyweight object.

Ralph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-dev/attachments/20090605/acb5a7b0/attachment.htm>


More information about the slf4j-dev mailing list