diff options
author | shanedaniel <shane.daniel@amdocs.com> | 2018-01-26 17:41:19 +0000 |
---|---|---|
committer | shanedaniel <shane.daniel@amdocs.com> | 2018-01-26 21:40:30 +0000 |
commit | 6fe98f991c599af431cd4ae5c10db13a384b8541 (patch) | |
tree | f30022c7551e2f5bc1a4e2a64ca44d55a4ef017a | |
parent | fdd8de8305343fd63347fcd7757577aab52a483a (diff) |
Add logback.xml ref example
Issue-ID: LOG-139
Change-Id: I3837a49d68e1d79aa9c99c7b267a85153a1c8b6b
Signed-off-by: shanedaniel <shane.daniel@amdocs.com>
-rw-r--r-- | reference/logging-demo/resources/microservice/conf/logback.xml | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/reference/logging-demo/resources/microservice/conf/logback.xml b/reference/logging-demo/resources/microservice/conf/logback.xml new file mode 100644 index 0000000..439c03f --- /dev/null +++ b/reference/logging-demo/resources/microservice/conf/logback.xml @@ -0,0 +1,159 @@ +<configuration debug="false" scan="true" scanPeriod="3 seconds"> + <!--<jmxConfigurator /> --> + <!-- directory path for all other type logs --> + <property name="logDir" value="/var/log/onap" /> + <property name="componentName" value="logging-demo"></property> + <property name="subComponentName" value="demo"></property> + <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" /> + <!-- default eelf log file names --> + <property name="generalLogName" value="error" /> + <property name="metricsLogName" value="metric" /> + <property name="auditLogName" value="audit" /> + <property name="debugLogName" value="debug" /> + <property name="queueSize" value="256" /> + <property name="maxFileSize" value="50MB" /> + <property name="maxHistory" value="30" /> + <property name="totalSizeCap" value="10GB" /> + <property name="pattern" value="%nopexception%logger|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%level|%replace(%replace(%replace(%message){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}|%replace(%replace(%replace(%mdc){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}|%replace(%replace(%replace(%rootException){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}|%replace(%replace(%replace(%marker){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}|%thread|%n"/> + <!-- Example evaluator filter applied against console appender --> + <appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT"> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <!-- ============================================================================ --> + <!-- EELF Appenders --> + <!-- ============================================================================ --> + <!-- The EELFAppender is used to record events to the general application + log --> + <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELF"> + <file>${logDirectory}/${generalLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELF"> + <!-- deny all events with a level below INFO, that is TRACE and DEBUG --> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>INFO</level> + </filter> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELF" /> + </appender> + <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFAudit"> + <file>${logDirectory}/${auditLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFAudit"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFAudit" /> + </appender> + <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFMetrics"> + <file>${logDirectory}/${metricsLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFMetrics"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFMetrics" /> + </appender> + <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFDebug"> + <file>${logDirectory}/${debugLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFDebug"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFDebug" /> + <includeCallerData>true</includeCallerData> + </appender> + <!-- ============================================================================ --> + <!-- EELF loggers --> + <!-- ============================================================================ --> + <logger additivity="false" level="info" name="com.att.eelf"> + <appender-ref ref="asyncEELF" /> + <appender-ref ref="asyncEELFDebug" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.security"> + <appender-ref ref="asyncEELFSecurity" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.perf"> + <appender-ref ref="asyncEELFPerformance" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.server"> + <appender-ref ref="asyncEELFServer" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.policy"> + <appender-ref ref="asyncEELFPolicy" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.audit"> + <appender-ref ref="asyncEELFAudit" /> + </logger> + <logger additivity="false" level="info" name="com.att.eelf.metrics"> + <appender-ref ref="asyncEELFMetrics" /> + </logger> + <!-- Spring related loggers --> + <logger level="WARN" name="org.springframework" /> + <logger level="WARN" name="org.springframework.beans" /> + <logger level="WARN" name="org.springframework.web" /> + <logger level="WARN" name="com.blog.spring.jms" /> + <logger level="INFO" name="com.att" /> + <!-- Other Loggers that may help troubleshoot --> + <logger level="WARN" name="net.sf" /> + <logger level="WARN" name="org.apache.commons.httpclient" /> + <logger level="WARN" name="org.apache.commons" /> + <logger level="WARN" name="org.apache.coyote" /> + <logger level="WARN" name="org.apache.jasper" /> + <!-- Camel Related Loggers (including restlet/servlet/jaxrs/cxf logging. + May aid in troubleshooting) --> + <logger level="WARN" name="org.apache.camel" /> + <logger level="WARN" name="org.apache.cxf" /> + <logger level="WARN" name="org.apache.camel.processor.interceptor" /> + <logger level="WARN" name="org.apache.cxf.jaxrs.interceptor" /> + <logger level="WARN" name="org.apache.cxf.service" /> + <logger level="WARN" name="org.restlet" /> + <logger level="WARN" name="org.apache.camel.component.restlet" /> + <!-- logback internals logging --> + <logger level="WARN" name="ch.qos.logback.classic" /> + <logger level="WARN" name="ch.qos.logback.core" /> + <root> + <appender-ref ref="asyncEELF" /> + <!-- <appender-ref ref="asyncEELFDebug" /> --> + </root> +</configuration> |