-
Hi I am trying to configure logback and access logs but this doesnt
appear to work. following the documentation i've come up with the below
jetty.xml. However the logback-access.xml doesn't ever seem to be read.
-
<Get name="handler">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.server.handler.RequestLogHandler">
<Set name="requestLog">
<Set name="requestLogHandler">
<New id="requestLogImpl"
class="ch.qos.logback.access.jetty.RequestLogImpl"></New>
<Set name="fileName">/etc/go/logback-access.xml</Set>
</Set>
</Set>
</New>
</Arg>
</Call>
</Get>
the below is the logback.xml (which appears to be needed but is missing
from the documentation.
-
<configuration>
<!-- To Be Managed by puppet -->
<include file="/etc/go/logback-include.xml"/>
<appender name="SOCKET"
class="ch.qos.logback.classic.net.SocketAppender">
<remoteHost> {logstash server }</remoteHost>
<port>3319</port>
<reconnectionDelay>10000</reconnectionDelay>
<includeCallerData>true</includeCallerData>
<encoder>
<pattern>%h %l %u [%t] "%r" %s %b "%i{Referer}"
"%i{User-Agent}"</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>/var/log/go-server/lbfile.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>lbfile.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<maxHistory>7</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
<append>true</append>
<!-- set immediateFlush to false for much higher logging throughput -->
<immediateFlush>true</immediateFlush>
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %date{ISO8601} -
%msg%n</pattern>
</encoder>
</appender>
<appender name="FILEac"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/go-server/lbaccess.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>lbaccess.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<maxHistory>7</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
<append>true</append>
<encoder>
<pattern>combined</pattern>
</encoder>
</appender>
<root level="WARN">
<appender-ref ref="FILE" />
-
finally the below is the logback-access.xml which doenst seem to be
imported (the base log file isnt created)
<configuration>
<!-- always a good activate OnConsoleStatusListener -->
<statusListener
class="ch.qos.logback.core.status.OnConsoleStatusListener" />
<appender name="ROLFILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/go-server/lb-access.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>lbaccess.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>combined</pattern>
</encoder>
</appender>
<appender-ref ref="ROLFILE" />
</configuration>
-
Many Thanks for any help, Barry
--
You received this message because you are subscribed to the Google Groups
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.