Skip to content

Commit

Permalink
less verbose console output during unit tests, and log to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
pgalbraith committed Sep 29, 2018
1 parent 8ee9172 commit d1dd1da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crawler4j/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE XML>
<configuration>

<property name="LOG_HOME" value="target/test-logs" />
<property name="LOG_FILE_NAME" value="/crawler4j.log" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>%date{HH:mm:ss} %-5level [%thread] - [%logger{0}]- %msg%n</pattern>
</encoder>
</appender>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${LOG_HOME}/${LOG_FILE_NAME}</file>
<append>false</append>
<encoder>
<pattern>%date %-5level [%thread] - [%logger] - %msg%n</pattern>
</encoder>
</appender>

<logger name="com.github.tomakehurst" level="ERROR"/>
<logger name="org.apache.http" level="WARN" />
<logger name="org.eclipse.jetty" level="ERROR" />

<root level="DEBUG">
<appender-ref ref="STDOUT" />
<!--<appender-ref ref="FILE" />-->
<appender-ref ref="FILE" />
</root>
</configuration>

0 comments on commit d1dd1da

Please sign in to comment.