Custom appender: no stack traces?

Hi, I wrote a custom appender that just writes to a circular queue: public class MemoryAppender extends AppenderBase<ILoggingEvent> { stuff } I configure it as follows: <appender name="ringLogger" class="com.xxxxxxxx.MemoryAppender"> <limit>1000</limit> </appender> His append NEVER receives stack traces: public void add(ILoggingEvent loggingEntry) { boolean hasStackTrace = loggingEntry.getCallerData(); /* always false ! */ } Any idea why this would be? This appender is just about as simple as it can get ...... --Chris

On 08/03/2011 6:36 PM, Christopher Piggott wrote:
Hi, I wrote a custom appender that just writes to a circular queue:
public class MemoryAppender extends AppenderBase<ILoggingEvent> { stuff }
I configure it as follows:
<appender name="ringLogger" class="com.xxxxxxxx.MemoryAppender"> <limit>1000</limit> </appender>
His append NEVER receives stack traces:
public void add(ILoggingEvent loggingEntry) { boolean hasStackTrace = loggingEntry.getCallerData(); /* always false ! */ }
Any idea why this would be? This appender is just about as simple as it can get ......
--Chris
Hi Chris, Caller data *extract* caller data from the current thread. You probably want getThrowableProxy() on ILoggingEvent. Shout here if you run into further problems. -- Ceki -- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. If interested, please email your resume to hr@qos.ch.

Thanks very much. That wasn't clear to me ... it would be a cool thing to add to the examples :) works great now. Thanks again.
Caller data *extract* caller data from the current thread. You probably want getThrowableProxy() on ILoggingEvent.
Shout here if you run into further problems.
-- Ceki
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. If interested, please email your resume to hr@qos.ch. _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
participants (2)
-
Ceki Gülcü
-
Christopher Piggott