tware.metricshub-agent.0.9.05.source-code.log4j2.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <!-- If the log level is updated this will filter log events based on the loggerLevel context variable --> <DynamicThresholdFilter key="loggerLevel" onMatch="ACCEPT" onMismatch="DENY"> <KeyValuePair key="DEBUG" value="DEBUG" /> <KeyValuePair key="ERROR" value="ERROR" /> <KeyValuePair key="INFO" value="INFO" /> <KeyValuePair key="WARN" value="WARN" /> <KeyValuePair key="TRACE" value="TRACE" /> <KeyValuePair key="OFF" value="OFF" /> <KeyValuePair key="ALL" value="ALL" /> </DynamicThresholdFilter> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout disableAnsi="false" pattern="%highlight{[%date{ISO8601}][%-5level][%logger{1.}] %m%n}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=cyan, DEBUG=green bold, TRACE=blue}" /> <ThresholdFilter level="off"/> </Console> <Routing name="Routing"> <Routes pattern="$${ctx:logId}"> <!-- This route is chosen if ThreadContext has loggerLevel = DEBUG/INFO/ERROR/WARN/TRACE. --> <Route> <RollingFile name="Rolling-${ctx:logId}" fileName="${ctx:outputDirectory}/${ctx:logId}-${date:yyyy-MM-dd-hh-mm-ss}.log" filePattern="${ctx:outputDirectory}/${date:yyyy-MM}/${ctx:logId}-%d{yyyy-MM-dd}-%i.log.gz"> <PatternLayout pattern="[%date{ISO8601}][%-5level][%logger{1.}] %m%n" /> <Policies> <TimeBasedTriggeringPolicy /> <SizeBasedTriggeringPolicy size="100 MB" /> </Policies> <DefaultRolloverStrategy> <Delete basePath="${ctx:outputDirectory}" maxDepth="3"> <IfFileName glob="*/*${ctx:logId}*.log.gz" /> <IfLastModified age="2d" /> </Delete> </DefaultRolloverStrategy> </RollingFile> </Route> </Routes> </Routing> </Appenders> <Loggers> <Root level="error" additivity="false"> <appender-ref ref="Console" /> </Root> <!-- Requests handling logger --> <logger name="org.sentrysoftware" level="off"> <appender-ref ref="Routing"> <ThreadContextMapFilter onMatch="DENY" onMismatch="ACCEPT"> <KeyValuePair key="loggerLevel" value="OFF" /> </ThreadContextMapFilter> </appender-ref> </logger> <!-- Agent logger --> <logger name="org.sentrysoftware.metricshub.agent" level="trace"> <appender-ref ref="Console" /> </logger> </Loggers> </Configuration>