<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The issue is in what the benefit is in having Markers for each of the various kinds of alerts. 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. Documentation is in extensions.html.<div><br></div><div>The MDC is appropriate to capture information that would be common to any log record written during the lifetime of the request. The EventData is just for the single event.<br><div><br></div><div>Ralph</div><div><br><div><div>On Jun 4, 2009, at 4:03 AM, Szel, Zoltan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi all,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">we are planning to build alerting functionality around the SLF4J API and we thought about leveraging the Marker API for this. The reason why we need Markers is simple, more information have to be provided to perform the required LoggingEvent => AlertEvent conversion. What I have in my mind is the following:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Create an Alert marker which implements the marker interface + have additional getters/setters to provide the required properties to the alerting appender. The usage would look like this:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Logger.error(new Alert(…),”The aircondition is down”)<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">However this does not seems to be the recommended way for using Markers where you would consult with the MarkerFactory for the appropriate Marker instance(MarkerFactory.getMarker(“ALERT”)).<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">What’s your thought on using Marker’s in this way? If you see any problem with it what would you recommend to provide extra contextual data to the log message(MDC is not appropriate here given the amount of code one might have to write to populate the Map)?<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks for your help in advance!<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Kind Regards,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; color: black; ">Zoltan Szel<br></span><b><span style="font-size: 7.5pt; font-family: Arial, sans-serif; color: black; ">Morgan Stanley | IDEAS Practice Areas<br></span></b><span style="font-size: 7.5pt; font-family: Arial, sans-serif; color: black; ">Lechner Odon fasor 8 | Floor 07<br>Budapest, 1095<br>Phone: +36 1 881-3978<br><a href="mailto:Zoli.Szel@MorganStanley.com" style="color: blue; text-decoration: underline; "><span style="color: blue; ">Zoli.Szel@MorganStanley.com</span></a></span><o:p></o:p></div></div></div><div><hr></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in; "><span style="font-size: 8pt; color: gray; "><font color="gray" face="Arial" size="1">NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.<span class="Apple-converted-space"> </span><span style="font-size: 7.5pt; color: gray; font-family: Arial, sans-serif; ">Morgan Stanley may monitor and store emails to the extent permitted by applicable law.</span></font></span></div><div></div>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@slf4j.org" style="color: blue; text-decoration: underline; ">dev@slf4j.org</a><br><a href="http://www.slf4j.org/mailman/listinfo/dev" style="color: blue; text-decoration: underline; ">http://www.slf4j.org/mailman/listinfo/dev</a></div></span></blockquote></div><br></div></div></body></html>