Skip to content

Commit

Permalink
Use logback instead of simplelogger
Browse files Browse the repository at this point in the history
  • Loading branch information
marlind89 committed Dec 9, 2019
1 parent 1418ade commit 0e7aab8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.8.0-beta4</version>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.3.0-alpha5</version>
</dependency>


<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
37 changes: 37 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- You can configure per-logger level at this point -->
<!-- This set of preconfigured loggers is good if you want to have a DEBUG level as baseline -->
<logger name="io.netty" level="INFO"/>
<logger name="reactor" level="INFO"/>
<logger name="com.github.langebangen.kensa" level="DEBUG"/>

<!-- Display the logs in your console with the following format -->
<!-- You can learn more about this here: https://logback.qos.ch/manual/layouts.html#ClassicPatternLayout -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<!-- Log to a file as well, including size and time based rolling -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>kensa.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>90</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-40.40logger{39} : %msg%n</Pattern>
</encoder>
<prudent>true</prudent>
</appender>

<!-- Here you can set the base logger level. If DEBUG is too chatty for you, you can use INFO -->
<!-- Possible options are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF -->
<root level="DEBUG">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
3 changes: 0 additions & 3 deletions src/main/resources/simplelogger.properties

This file was deleted.

0 comments on commit 0e7aab8

Please sign in to comment.