logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Nyolt <a31bd...@freenet.de>
Subject Re: Logging only specific number of lines
Date Wed, 02 Mar 2011 22:00:52 GMT

Am 02.03.2011 22:47, schrieb Kannan G:
> 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?

I don't know of any option for that, but you can easily write your own appender, inheriting
the one you are using at the moment.

> 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.

Of course you can specify a seperate syslog appender and set the level to FATAL.  (Am I missing
The same is true for a FileAppender with a level of ERROR (or whatever level exceptions are)
- but I assume that your true problem is, that you want to filter out all events with no Throwable
attached to it?
In this case you could also writea new Filter which does just that and append it to the FileAppender.

Best regards,

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

View raw message