<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div class="" style="">All</div><div class="" style=""> I extend <span style="font-size: 12pt;" class="">ch.qos.logback.classic.PatternLayout and override </span><span style="font-size: 12pt;" class="">doLayout() to</span><span style="font-size: 12pt;" class=""> mask certain things like credit card number using reg-ex.</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">This works great with FileAppender and ConsoleAppender.</div><div class="" style="color: rgb(0, 0, 0); font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;"><br class="" style=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">However while configuring SyslogAppender I found out that we can only use suffixPattern to format the content and <span style="font-size: 12pt;" class="">PatternLayout cannot be specified.</span></div><div class="" style="color: rgb(0, 0, 0);
font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;"><span style="font-size: 12pt;" class=""><br class="" style=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">Here is the explanation on Logback site --</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;"><span style="font-family: Verdana, Arial, SunSans-Regular, sans-serif; font-size: 16px; line-height: 20.799999237060547px;" class=""><br class="" style=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Verdana, Arial, SunSans-Regular,
sans-serif; font-style: normal; background-color: transparent;"><span style="font-family: Verdana, Arial, SunSans-Regular, sans-serif; font-size: 16px; line-height: 20.799999237060547px;" class="">Given that the format of a syslog request follows strict rules, you cannot freely specify the layout to be used with SyslogAppender. However, you can use </span><span class="" style="border-width: 1px; border-style: dotted; border-color: rgb(187, 187, 187) rgb(170, 170, 170); padding-left: 2px; padding-right: 2px; font-family: Arial, sans-serif; font-size: medium; line-height: 20.799999237060547px;">SuffixPattern</span><span style="font-family: Verdana, Arial, SunSans-Regular, sans-serif; font-size: 16px; line-height: 20.799999237060547px;" class=""> option instead to influence the contents of the message sent to the syslog daemon.</span><br class="" style=""></div>
<div class="" style=""><br class="" style=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">So what are my options to change the string content before its sent to SyslogAppender ?</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">I'm on logback version 1.0.3 .</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-style: normal; background-color: transparent;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">Thanks</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;">Kumar</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;"> </div></div></body></html>