<font>Hi !<br><br>We've recently made the switch from Log4j to Logback.
We use Syslog to send logfiles to our logserver, and things generally
work.<br></font><font><br>But when there are stacktraces in the logs we get in trouble. SyslogAppender will replace lineshifts with '</font><font>#011</font>'
to make the logentry a single line. Then it will cut each line that is
to long according to the syslog limit of 2K/line. Only the fist segment
will arrive in the correct log. The remaining
segments do not contain everything in the suffixPattern, and our
regexp will
not have anything to match. The segment will end up in a 'trash' log for
unmatchable loglines.<br>
<br><font>My config for the SyslogAppender looks like this:<br><br> <contextName>company-${CONTEXT_PATH}-${environment}</contextName><br> <appender name="LOGSERVER_FILE" class="ch.qos.logback.classic.net.SyslogAppender"><br>
<syslogHost>localhost</syslogHost><br> <facility>local3</facility><br> <SuffixPattern>%contextName %d{dd.MM.yyyy HH:mm:ss.SSS} [%p] [%c{1}] [%X{ThreadId}]: %m%n</SuffixPattern><br>
</appender><br><br>We use the contextName property to control the logfilename. On the receiving end we read the </font><font>contextName parameter (</font>using a regexp) <font>for each log line, and write the line to a file </font>with a corresponding name<font>.<br>
<br>We had a similar problem when we used Log4J (Where the Tag element
was used in the same manner), and fixed it back then by writing a custom
log4j SyslogAppender. But the main purpose of moving to Logback is to
loose all our home brew logging stuff, we don't want to go down that
path again. If we can't make Logback work out of the box with Syslog
we'll probably end up going back to Log4J. (Another alternative is to
replace Syslog with Gelf, but that's further down the road).<br>
<br>However, I imagine Logback and Syslog being a common combination,
and surely someone must have this working out of the box. Any advice
will be appreciated. My requirements are simple:<br>-must work with no custom logging code, only config (preferably xml)<br>
-stacktraces in logs must work<br>-must be able to fully control the filename on the recieving end.<br><br>cheers,<br>Ingebrigt Berg</font><font><br></font>