Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!-- if-then-else form -->
<if condition='property("profile").contains("PROD")'>
<then>
<property name="LOGGER_LEVEL" value="INFO" />
<property name="CONSOLE_LOGGER_LEVEL" value="WARN" />
</then>
<else>
<property name="LOGGER_LEVEL" value="INFO" />
<property name="CONSOLE_LOGGER_LEVEL" value="INFO" />
</else>
</if>
<!-- Console -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${CONSOLE_LOGGER_LEVEL}</level>
</filter>
<encoder>
<pattern>%d{dd/MMM/yyyy HH:mm:ss} %c %5p - %m %n</pattern>
</encoder>
</appender>
<!-- Plain Text Rolling Appender -->
<appender name="server"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<Append>true</Append>
<File>${catalina.home}/logs/education-web.log</File>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder>
<pattern>%date{dd/MMM/yyyy HH:mm:ss} %c %5p - %m %n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.home}/logs/education-web.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
</appender>
<!-- Plain Text Rolling Appender -->
<appender name="server-error"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<Append>true</Append>
<File>${catalina.home}/logs/education-web-error.log</File>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder>
<pattern>%date{dd/MMM/yyyy HH:mm:ss} %c %5p - %m %n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.home}/logs/education-web-error.log.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
</appender>
<logger name="ch.qos" level="WARN" />
<logger name="org.slf4j" level="WARN" />
<logger name="org.jboss.logging" level="WARN" />
<logger name="net.sf" level="WARN" />
<logger name="net.sourceforge.wurfl.core.resource" level="WARN"/>
<logger name="org.thymeleaf.TemplateEngine" level="${LOGGER_LEVEL:-WARN}"/>
<logger name="org.springframework" level="${LOGGER_LEVEL:-INFO}" />
<logger name="org.hibernate.type" level="${LOGGER_LEVEL:-INFO}" />
<logger name="org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl" level="ERROR"/>
<logger name="com.bemobi" level="${LOGGER_LEVEL:-INFO}">
<appender-ref ref="server" />
<appender-ref ref="server-error" />
</logger>
<root level="${CONSOLE_LOGGER_LEVEL:-INFO}">
<appender-ref ref="console" />
<appender-ref ref="server" />
<appender-ref ref="server-error" />
</root>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.