Advertisement
Guest User

log4j2.xml

a guest
Apr 3rd, 2021
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.54 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Configuration status="INFO" monitorInterval="30">
  3.     <Properties>
  4.         <Property name="LOG_PATTERN">
  5.             [ %d{yyyy-MMM-dd HH:mm:ss a} ] - [%t] %-5level %logger{36} - %msg%n
  6.         </Property>
  7.     </Properties>
  8.     <Appenders>
  9.         <Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
  10.             <PatternLayout pattern="${LOG_PATTERN}"/>
  11.         </Console>
  12.         <RollingFile name="FileAppender" fileName="/home/ec2-user/apps/wc-notification-service-2/wc-notification.out"
  13.                     filePattern="/home/ec2-user/apps/wc-notification-service-2/wc-notification.out-%d{yyyy-MM-dd}-%i">
  14.             <PatternLayout>
  15.                 <Pattern>${LOG_PATTERN}</Pattern>
  16.             </PatternLayout>
  17.             <Policies>
  18.                 <SizeBasedTriggeringPolicy size="1 KB" />
  19.             </Policies>
  20.             <DefaultRolloverStrategy>
  21.                 <Delete basePath="/home/ec2-user/apps/wc-notification-service-2">
  22.                     <IfFileName glob="wc-notification.out-*" />
  23.                     <IfAny>
  24.                         <IfAccumulatedFileSize exceeds="5 KB" />
  25.                         <IfAccumulatedFileCount exceeds="5" />
  26.                     </IfAny>
  27.                 </Delete>
  28.             </DefaultRolloverStrategy>
  29.         </RollingFile>
  30.     </Appenders>
  31.     <Loggers>
  32.         <Root level="info">
  33.             <!--<AppenderRef ref="ConsoleAppender" /> -->
  34.             <AppenderRef ref="FileAppender" />
  35.         </Root>
  36.     </Loggers>
  37. </Configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement