|
|
- <Configuration status="INFO" packages="com.digiwin.app.log">
- <Properties>
- <Property name="LOG_PATTERN">
- %d{yyyy/MM/dd HH:mm:ss} %-5p [%X{traceId}] %m%n
- </Property>
- </Properties>
- <Appenders>
- <Console name="consoleAppender" target="SYSTEM_OUT" follow="true">
- <PatternLayout pattern="${LOG_PATTERN}" />
- </Console>
-
- <RollingFile name="rollingfileAppender" fileName="platform/log/Digiwin${sys:logFileIdentifier}.log"
- filePattern="platform/log/Digiwin${sys:logFileIdentifier}-%d{yyyy-MM-dd}.log" append="true">
- <PatternLayout pattern="${LOG_PATTERN}" />
- <Filters>
- <ThresholdFilter level="fatal" onMatch="ACCEPT"
- onMismatch="NEUTRAL" />
- <ThresholdFilter level="error" onMatch="ACCEPT"
- onMismatch="NEUTRAL" />
- <ThresholdFilter level="warn" onMatch="ACCEPT"
- onMismatch="NEUTRAL" />
- <ThresholdFilter level="info" onMatch="ACCEPT"
- onMismatch="NEUTRAL" />
- <ThresholdFilter level="debug" onMatch="ACCEPT"
- onMismatch="DENY" />
- </Filters>
- <Policies>
- <TimeBasedTriggeringPolicy />
- </Policies>
- <DefaultRolloverStrategy>
- <Delete basePath="platform/log/" maxDepth="1" followLinks="true">
- <IfFileName glob="Digiwin-*.log" />
- <IfLastModified age="@logFileReservedDay@" />
- </Delete>
- </DefaultRolloverStrategy>
- </RollingFile>
-
- <!-- DwMongoDBAppender name="logServiceLogAppender" databaseName="dap" collectionName="logs" server="@logMongodbServer@" port="@logMongodbPort@">
- <PatternLayout pattern="${LOG_PATTERN}" />
- </DwMongoDBAppender>
- <DwMongoDBAppender name="logServiceTraceAppender" databaseName="dap" collectionName="traces" server="@logMongodbServer@" port="@logMongodbPort@">
- <PatternLayout pattern="${LOG_PATTERN}" />
- </DwMongoDBAppender>
-
- <DwLogMongoAppender name="mongoSysAppender" databaseName="dap" collectionName="logs" server="@logMongodbServer@" port="@logMongodbPort@">
- <PatternLayout pattern="${LOG_PATTERN}" />
- </DwLogMongoAppender>
- <Async name="asyncSysAppender">
- <AppenderRef ref="mongoSysAppender"/>
- </Async-->
-
- <!-- 1.引入appender -->
- <DwLog4j2Appender name="dwAppender" app="demo-athenaopt" endpoint="@lmcUrl@">
- <PatternLayout pattern="${LOG_PATTERN}"/>
- </DwLog4j2Appender>
- <!-- 2.引入异步节点 -->
- <Async name="ASYNC-dwAppender">
- <AppenderRef ref="dwAppender"/>
- </Async>
-
- </Appenders>
- <Loggers>
- <!--<Root level="@logLevel@">-->
- <Root level="@logLevel@">
- <!-- 3.引入使用 -->
- <appender-ref ref="ASYNC-dwAppender"/>
-
- <appender-ref ref="consoleAppender" />
- <appender-ref ref="rollingfileAppender" />
- <!-- appender-ref ref="asyncSysAppender" /-->
- </Root>
- <logger name="io.lettuce.core.protocol" level="ERROR">
- <appender-ref ref="consoleAppender" />
- <appender-ref ref="rollingfileAppender" />
- </logger>
- <!-- Logger name="com.digiwin.dwsys.service.impl.LogLogger" level="@logLevel@" additivity="false">
- <appender-ref ref="logServiceLogAppender" />
- </Logger>
- <Logger name="com.digiwin.dwsys.service.impl.TraceLogger" level="@logLevel@" additivity="false">
- <appender-ref ref="logServiceTraceAppender" />
- </Logger>
- <Logger name="org.mongodb.driver" level="ERROR" additivity="false">
- <appender-ref ref="rollingfileAppender" />
- </Logger-->
- </Loggers>
- </Configuration>
|