-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Aleksander edited this page Aug 27, 2019
·
14 revisions
LogBlock is based on logback package.
We will use logback.xml
for configuration. But you can use any other way of configuring, supported by logback (see Logback configuration)
As described in quick start guide, you should specify the encoder com.github.sidssids.blocklogger.encoder.BlockloggerPatternLayoutEncoder
:
<encoder class="com.github.sidssids.blocklogger.encoder.BlockloggerPatternLayoutEncoder" />
The encoder extends default PatternLayoutEncoder, so you can use any its configuration. There are extra properties:
-
profiling
- is a boolean value, used to enable\disable profiling information, attached to the closing block message.
Default value:true
-
appendParams
- is a boolean value, used to enable\disable params information, attached to the starting block message.
Default value:true
-
appendResult
- is a boolean value, used to enable\disable report information, attached to the closing block message.
Default value:true
-
appendExceptionInfo
- is a boolean value, used to enable\disable exception information, attached to the closing block message.
Default value:true
-
appendStackTrace
- is a boolean value, used to enable\disable exception stack trace after the closing block message.
Default value:true
-
indentEnabled
- is a boolean value, used to enable\disable indentation.
Default value:true
-
tabString
- is a string value, used as indent
Default value: '
Configuration example:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="com.github.sidssids.blocklogger.encoder.BlockloggerPatternLayoutEncoder">
<pattern>%d [%-10thread] %-5level %msg%n</pattern>
<profiling>true</profiling>
<appendParams>true</appendParams>
<appendResult>true</appendResult>
<appendExceptionInfo>false</appendExceptionInfo>
<appendStackTrace>false</appendStackTrace>
<indentEnabled>true</indentEnabled>
<tabString>|---</tabString>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</configuration>