[logback-user] Using JNDIBasedContextDiscriminator with access SiftingAppender

Xavier Dury kalgon at hotmail.com
Thu May 16 16:47:14 CEST 2013


Hi,

I would like to do something like this in my logback-access.xml:

<appender name="FILE" class="ch.qos.logback.access.sift.SiftingAppender">
  <discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator" />
  <sift>
    <appender class="ch.qos.logback.core.FileAppender">
      <file>/logs/${contextName}/access.log</file>
      <encoder class="ch.qos.logback.access.PatternLayoutEncoder">
        <pattern>%h %l %u %user %date "%r" %s %b</pattern>
      </encoder>
    </appender>
  </sift>
</appender>

but it doesn't work because I'm using a discriminator from logback-classic (JNDI).

As the only discriminator in logback-access is AccessEventDiscriminator, is there another way to split access logs in multiple files (one per application)?

Thanks,

Xavier 		 	   		  


More information about the Logback-user mailing list