[logback-user] How to get a unique content rollingFileAppender?

hax0r at sina.com hax0r at sina.com
Wed Apr 30 09:23:42 CEST 2014


I want such a rollingFileAppneder:Before appending new line to the current log file, the logger will check: if there is any same line in the current log file, it will not write the same content to the file.
I can not find such a file appender, so I want to customize it:

Firstly, I want to create a class extends the RollingFileAppneder, but I find that the field which point to current file in RollingFileAppneder is "friendly", I can not get the field in my own class.
There is an stupid option: I copy all the codes in the RollingFileAppneder, and changed some logic in the append part. 
Is there a elgant way to get such a unique content rollingFileAppender?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20140430/1643c9ed/attachment.html>


More information about the Logback-user mailing list