Changes for spaces instead of tabs.

This commit is contained in:
root 2018-07-26 12:54:28 +05:30
parent cd4dbef187
commit 2f0b1b46c9
1 changed files with 87 additions and 88 deletions

View File

@ -1,90 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Configuration xmlns:xi="http://www.w3.org/2001/XInclude" <Configuration xmlns:xi="http://www.w3.org/2001/XInclude"
packages="com.baeldung" status="WARN"> packages="com.baeldung" status="WARN">
<Appenders> <Appenders>
<xi:include <xi:include
href="log4j2-includes/console-appender_pattern-layout_colored.xml" /> href="log4j2-includes/console-appender_pattern-layout_colored.xml" />
<Console name="ConsoleAppender" target="SYSTEM_OUT"> <Console name="ConsoleAppender" target="SYSTEM_OUT">
<PatternLayout <PatternLayout
pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable" /> pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable" />
</Console> </Console>
<Console name="ConsoleRedAppender" target="SYSTEM_OUT"> <Console name="ConsoleRedAppender" target="SYSTEM_OUT">
<PatternLayout pattern="%style{%message}{red}%n" /> <PatternLayout pattern="%style{%message}{red}%n" />
<MarkerFilter marker="CONN_TRACE" /> <MarkerFilter marker="CONN_TRACE" />
</Console> </Console>
<Console name="ConsoleGreenAppender" target="SYSTEM_OUT"> <Console name="ConsoleGreenAppender" target="SYSTEM_OUT">
<PatternLayout <PatternLayout
pattern="%style{userId=%X{userId}:}{white} %style{%message}{green}%n" /> pattern="%style{userId=%X{userId}:}{white} %style{%message}{green}%n" />
</Console> </Console>
<Console name="ConsoleJSONAppender" target="SYSTEM_OUT"> <Console name="ConsoleJSONAppender" target="SYSTEM_OUT">
<JsonLayout complete="false" compact="false"> <JsonLayout complete="false" compact="false">
<KeyValuePair key="myCustomField" value="myCustomValue" /> <KeyValuePair key="myCustomField" value="myCustomValue" />
</JsonLayout> </JsonLayout>
</Console> </Console>
<File name="JSONLogfileAppender" <File name="JSONLogfileAppender" fileName="${sys:logging.folder.path}">
fileName="${sys:logging.folder.path}"> <JSONLayout compact="true" eventEol="true" />
<JSONLayout compact="true" eventEol="true" /> <BurstFilter level="INFO" rate="2" maxBurst="10" />
<BurstFilter level="INFO" rate="2" maxBurst="10" /> </File>
</File> <Async name="AsyncAppender" bufferSize="80">
<Async name="AsyncAppender" bufferSize="80"> <AppenderRef ref="JSONLogfileAppender" />
<AppenderRef ref="JSONLogfileAppender" /> </Async>
</Async> <!-- <Syslog name="Syslog" format="RFC5424" host="localhost" port="514"
<!-- <Syslog name="Syslog" format="RFC5424" host="localhost" port="514" protocol="TCP" facility="local3" connectTimeoutMillis="10000" reconnectionDelayMillis="5000"
protocol="TCP" facility="local3" connectTimeoutMillis="10000" reconnectionDelayMillis="5000" mdcId="mdc" includeMDC="true" /> <Failover name="FailoverAppender" primary="Syslog">
mdcId="mdc" includeMDC="true" /> <Failover name="FailoverAppender" primary="Syslog"> <Failovers> <AppenderRef ref="ConsoleAppender" /> </Failovers> </Failover> -->
<Failovers> <AppenderRef ref="ConsoleAppender" /> </Failovers> </Failover> --> <JDBC name="JDBCAppender" tableName="logs">
<JDBC name="JDBCAppender" tableName="logs"> <ConnectionFactory
<ConnectionFactory class="com.baeldung.logging.log4j2.tests.jdbc.ConnectionFactory"
class="com.baeldung.logging.log4j2.tests.jdbc.ConnectionFactory" method="getConnection" />
method="getConnection" /> <Column name="when" isEventTimestamp="true" />
<Column name="when" isEventTimestamp="true" /> <Column name="logger" pattern="%logger" />
<Column name="logger" pattern="%logger" /> <Column name="level" pattern="%level" />
<Column name="level" pattern="%level" /> <Column name="message" pattern="%message" />
<Column name="message" pattern="%message" /> <Column name="throwable" pattern="%ex{full}" />
<Column name="throwable" pattern="%ex{full}" /> </JDBC>
</JDBC> <RollingFile name="XMLRollingfileAppender" fileName="target/logfile.xml"
<RollingFile name="XMLRollingfileAppender" filePattern="target/logfile-%d{yyyy-MM-dd}-%i.log.gz">
fileName="target/logfile.xml" <XMLLayout />
filePattern="target/logfile-%d{yyyy-MM-dd}-%i.log.gz"> <Policies>
<XMLLayout /> <SizeBasedTriggeringPolicy
<Policies> size="17 kB" />
<SizeBasedTriggeringPolicy size="17 kB" /> </Policies>
</Policies> </RollingFile>
</RollingFile> <MapAppender name="MapAppender"/>
<MapAppender name="MapAppender"/> </Appenders>
</Appenders> <Loggers>
<Loggers> <Logger name="CONSOLE_PATTERN_APPENDER_MARKER" level="TRACE"
<Logger name="CONSOLE_PATTERN_APPENDER_MARKER" level="TRACE" additivity="false">
additivity="false"> <AppenderRef ref="ConsoleRedAppender" />
<AppenderRef ref="ConsoleRedAppender" /> </Logger>
</Logger> <Logger name="CONSOLE_PATTERN_APPENDER_THREAD_CONTEXT"
<Logger name="CONSOLE_PATTERN_APPENDER_THREAD_CONTEXT" level="INFO" additivity="false">
level="INFO" additivity="false"> <AppenderRef ref="ConsoleGreenAppender" />
<AppenderRef ref="ConsoleGreenAppender" /> <ThreadContextMapFilter>
<ThreadContextMapFilter> <KeyValuePair key="userId" value="1000" />
<KeyValuePair key="userId" value="1000" /> </ThreadContextMapFilter>
</ThreadContextMapFilter> </Logger>
</Logger> <Logger name="ASYNC_JSON_FILE_APPENDER" level="INFO"
<Logger name="ASYNC_JSON_FILE_APPENDER" level="INFO" additivity="false">
additivity="false"> <AppenderRef ref="AsyncAppender" />
<AppenderRef ref="AsyncAppender" /> </Logger>
</Logger> <!-- <Logger name="FAIL_OVER_SYSLOG_APPENDER" level="INFO" additivity="false">
<!-- <Logger name="FAIL_OVER_SYSLOG_APPENDER" level="INFO" additivity="false"> <AppenderRef ref="FailoverAppender" /> </Logger> -->
<AppenderRef ref="FailoverAppender" /> </Logger> --> <Logger name="JDBC_APPENDER" level="INFO" additivity="false">
<Logger name="JDBC_APPENDER" level="INFO" additivity="false"> <AppenderRef ref="JDBCAppender" />
<AppenderRef ref="JDBCAppender" /> </Logger>
</Logger> <Logger name="XML_ROLLING_FILE_APPENDER" level="INFO"
<Logger name="XML_ROLLING_FILE_APPENDER" level="INFO" additivity="false">
additivity="false"> <AppenderRef ref="XMLRollingfileAppender" />
<AppenderRef ref="XMLRollingfileAppender" /> </Logger>
</Logger> <Logger name="CONSOLE_JSON_APPENDER" level="TRACE"
<Logger name="CONSOLE_JSON_APPENDER" level="TRACE" additivity="false">
additivity="false"> <AppenderRef ref="ConsoleJSONAppender" />
<AppenderRef ref="ConsoleJSONAppender" /> </Logger>
</Logger> <Root level="DEBUG">
<Root level="DEBUG"> <AppenderRef ref="ConsoleAppender" />
<AppenderRef ref="ConsoleAppender" /> <AppenderRef ref="MapAppender" />
<AppenderRef ref="MapAppender" /> </Root>
</Root> </Loggers>
</Loggers>
</Configuration> </Configuration>