Skip to content

Commit

Permalink
Configure async loggers.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoathaydes committed Jan 16, 2022
1 parent f523880 commit 11640a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benchmark.sh
Expand Up @@ -10,7 +10,7 @@ set -e

COMMANDS=(
"java -Djava.util.logging.config.file=log-config/jul.properties -cp build/java:jul-libs/*:build/java:logback-libs/slf4j-api-1.7.33.jar Main" # Java (JUL)
"java -cp build/java:logback-libs/slf4j-api-1.7.33.jar:log-config:log4j-libs/* Main" # Java (Log4j2)
"java -cp build/java:logback-libs/slf4j-api-1.7.33.jar:log-config:log4j-libs/* -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector Main" # Java (Log4j2)
"java -cp build/java:log-config:logback-libs/* Main" # Java (Logback)
)

Expand Down
5 changes: 3 additions & 2 deletions log-config/log4j2.xml
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<File name="File" bufferedIO="true" fileName="proc_out.txt">
<File name="File" bufferedIO="true" fileName="proc_out.txt"
immediateFlush="false">
<PatternLayout pattern="%msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="info">
<Root level="info" includeLocation="false">
<AppenderRef ref="File"/>
</Root>
</Loggers>
Expand Down
7 changes: 6 additions & 1 deletion log-config/logback.xml
Expand Up @@ -6,8 +6,13 @@
<pattern>%msg%n</pattern>
</encoder>
</appender>
<appender name="ASYNC_FILE"
class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
<includeCallerData>false</includeCallerData>
</appender>

<root level="info">
<appender-ref ref="FILE" />
<appender-ref ref="ASYNC_FILE" />
</root>
</configuration>
Binary file added log4j-libs/disruptor-3.4.4.jar
Binary file not shown.

0 comments on commit 11640a2

Please sign in to comment.