logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Logging only specific number of lines
Date Thu, 03 Mar 2011 13:11:02 GMT
You can configure either one of the built-in throwable renderers or provide your own.  Look
at tests/input/xml/throwableRenderer1.xml for an example of configuration.  See org.apache.log4j.EnhancedThrowableRenderer
for options.

One the second, attach the SyslogAppender to the root logger, but set the threshold on the
appender to Fatal.  

Note: SyslogAppender uses sockets to talk with the syslog daemon.  Network (even on same machine)
access to the syslog is often disabled by default.

On Mar 2, 2011, at 3:47 PM, Kannan G wrote:

> Hi
> Since my application is in integration platform(Fuse) log files grow easily,
> so we thought of controlling it by logging only specific number of lines
> whenever exceptions are thrown. Is this possible with log4j to log specific
> number of lines say 30 lines only instead entire stacktrace?
> Also i have a requirement of logging fatal errors to syslog and application
> exceptions to separate file. Is this possible to let log4j categorize the
> error and send to different logs? Or any standard of way of doing this.
> Thanks.
> Kann

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message