I had same question in past and following worked for me.
I did not find property of syslog appender where TAG can be specified.
Formatting the message with square bracket in it containing the text
you want to put as TAG can do the job. e.g. you can configure your
Syslog appender as:
<appender name="SYSLOG-USER"
class="ch.qos.logback.classic.net.SyslogAppender">
<SyslogHost>${syslog.host}</SyslogHost>
<port>${syslog.port}</port>
<Facility>USER</Facility>
<SuffixPattern>[ABC] %logger %msg</SuffixPattern>
</appender>
In this case 'ABC' should show up as TAG in the Syslog message. You
can substitute this value dynamically from MDC context or properties
file. In case you want to substitute it from MDC context, you can use
some thing like:
<SuffixPattern>[%mdc{ABC}] %logger %msg</SuffixPattern>
Thanks,
Pradnya
On Thu, Jan 6, 2011 at 10:25 AM, Sujith Sukumaran <[email protected]> wrote:
>
> How can users specify the tag portion of a syslog message using the
> SyslogAppender. Is there a tag property on the SyslogAppender ?.
> So, if message is logged it would automatically prefix the message with the
> tag.
>
> Regards,
> Sujith
>
>
> _______________________________________________
> Logback-user mailing list
> [email protected]
> http://qos.ch/mailman/listinfo/logback-user
>
>
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user