[logback-user] syslogAppender, suffixPattern, "valid conversion word"

Ted Timmons ted at perljam.net
Thu Dec 29 02:52:25 CET 2011


Hi. I have a file-based logback in place. I'm adding syslogging to it.
Here's a sample configuration:

  <appender name="SYSLOG-MAIN"
class="ch.qos.logback.classic.net.SyslogAppender">
    <syslogHost>remotehost</syslogHost>
    <facility>local6</facility>
    <!-- <suffixPattern>syslog hello world</suffixPattern> -->
    <!-- <suffixPattern>atime:%d{yyyy-MM-dd'T'HH:mm:ss.SSS}\tapp:AN\taenvironment:\tahost:\tathread:%t\tapriority:%p\tacategory:%c{35}\tandc:\tamessage:%m%n</suffixPattern>
-->
    <!-- <suffixPattern>atime:%d{"yyyy-MM-dd'T'HH:mm:ss.SSS"}\tapp:AN\taenvironment:\tahost:\tathread:%t\tapriority:%p\tacategory:%c{35}\tandc:\tamessage:%m%n</suffixPattern>
-->
  </appender>

It works with the suffixPattern lines commented out. If I use the
first line ("hello world"), I get the following:

01:46:35,272 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
- About to instantiate appender of type
[ch.qos.logback.classic.net.SyslogAppender]
01:46:35,276 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
- Naming appender as [SYSLOG-MAIN]
01:46:35,293 |-ERROR in
ch.qos.logback.core.pattern.parser.Compiler at 2db7ae22 - There is no
conversion class registered for conversion word [nopexsyslog]
01:46:35,293 |-ERROR in
ch.qos.logback.core.pattern.parser.Compiler at 2db7ae22 - [nopexsyslog]
is not a valid conversion word

Okay, I think I understand "nopex". But why isn't plain text acceptable?

I get similar errors for the next two lines, which is what I'd
actually like the logging to appear as.

01:20:12,978 |-ERROR in
ch.qos.logback.core.pattern.parser.Compiler at 31f9338f - There is no
conversion class registered for conversion word [nopexatime]
01:20:12,978 |-ERROR in
ch.qos.logback.core.pattern.parser.Compiler at 31f9338f - [nopexatime] is
not a valid conversion word

I'm running logback-0.9.28.

Thanks,
-ted


More information about the Logback-user mailing list