Re: StatusLogger

2015-11-30 Thread Ralph Goers
Log4j2 logs Message objects. The object being logged is contained within the message. You would normally call getFormattedMessage() to get the message String if that is what you are after. Ralph > On Nov 30, 2015, at 7:10 AM, Nicholas Duane wrote: > > Is there a way within an

RE: StatusLogger

2015-11-30 Thread Nicholas Duane
I'm not necessarily after the string. I'm trying to get the original object that was passed to one of the logging methods. It could have been a string or some complex object. Thanks, Nick > Subject: Re: StatusLogger > From: ralph.go...@dslextreme.com > Date: Mon, 30 Nov 2015 08:30:37 -0700 >

Re: StatusLogger

2015-11-30 Thread Ralph Goers
From Log4j’s perspective, what is logged is the Message. Each message may have a different way of encapsulating its information. Ralph > On Nov 30, 2015, at 8:33 AM, Nicholas Duane wrote: > > I'm not necessarily after the string. I'm trying to get the original object > that

Re: StatusLogger

2015-11-30 Thread Ralph Goers
To elaborate a bit more, if you call Log4j to log just a String then a SimpleMessage will be passed in. If you log a String with parameters then you will have either a ParameterizedMessage (the default) or a StringFormattedMessage, MessageFormatMessage or FormattedMessage, depending on the

RE: StatusLogger

2015-11-30 Thread Nicholas Duane
As I mentioned, what we're trying to do is capture events from our appenders. However, the part I didn't mention is that we *might* want to also "failover" the event which was sent to our appender to another appender. In that case we want to log the event our appender received to our

Re: StatusLogger

2015-11-30 Thread Ralph Goers
You would call logMessage and pass the Message object. Ralph > On Nov 30, 2015, at 1:19 PM, Nicholas Duane wrote: > > As I mentioned, what we're trying to do is capture events from our appenders. > However, the part I didn't mention is that we *might* want to also >

RE: StatusLogger

2015-11-30 Thread Nicholas Duane
Is there a way within an appender to get the original object logged? In log4net we call LoggingEvent.MessageObject. In log4j2 it doesn't seem as straight forward. A LogEvent object has a getMessage() method but I assume that's some sort of wrapper around the object that was logged. We