
Thanks a lot Ceki Gulcu. I will follow your instructions. Do you know about any other logging APIs for jav which can support both these requirement? I am lokking at Protomatter syslog which probably can help but it looks complicated to implement compared to Logback. - Pradnya On Fri, Oct 22, 2010 at 11:17 AM, Ceki Gulcu <ceki@qos.ch> wrote:
On 22.10.2010 17:02, Pradnya Gawade wrote:
Hi,
I have following requirements when sending the log from a java web application to syslog server:
1. When logging the stack trace in case of exceptions, all the stack strace should be seen as a single message.
Logback does not support this feature. Please create a jira issue asking for it.
2. Need to send either or all of the following information in logs- name of the web application, URL, version of the application.
Via MDC =======
Add the following code when your web-app starts:
MDC.put("appName", ...); MDC.put("appURL", ...); MDC.put("appVersion", ...);
In logback.xml:
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"> <SuffixPattern>%mdc{appName} %mdc{appURL} %mdc{appVersion} %logger %msg</SuffixPattern> </appender>
By system properties ====================
Set the following system properties:
-DappName=... -DappURL=... -DappVersion
In logback.xml:
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"> <SuffixPattern>%property{appName} %property{appURL} %property{appVersion} %logger %msg</SuffixPattern> </appender>
HTH
As per my knowledge, Syslog appender of Logback doesnot fit to above requirements. I am also looking for any other logging APIs which can satisfy these requirements. Any ideas? Thanks in advance.
- Pradnya
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user