Add logging configuration files for JUL, Log4j and SLF4J to the Spring Boot Actuator Sample application.

This commit is contained in:
John Blum
2019-04-28 19:17:09 -07:00
parent 280ee00f61
commit 9e3e8f45d2
3 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# java.util.logging (JUL) configuration
org.apache=ERROR
org.springframework=ERROR

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="error">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{1.} - %msg%n"/>
</Console>
<File name="File" fileName="build/logs/spring-test.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{1.} - %msg%n"/>
</File>
<Null name="nop"/>
</Appenders>
<Loggers>
<Logger name="org.apache" level="error"/>
<Logger name="org.springframework" level="error"/>
<Root level="error">
<AppenderRef ref="Console"/>
<!--AppenderRef ref="File" /-->
</Root>
</Loggers>
</Configuration>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<logger name="ch.qos.logback" level="${logback.log.level:-ERROR}"/>
<logger name="org.apache" level="${logback.log.level:-ERROR}"/>
<logger name="org.springframework" level="${logback.log.level:-ERROR}"/>
<root level="${logback.log.level:-ERROR}">
<appender-ref ref="console"/>
</root>
</configuration>