log4j2.properties 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #Declare loggers
  2. status=error
  3. name=Log4j2PropertiesConfig
  4. appenders=a_console, a_rolling
  5. rootLogger.level=info
  6. rootLogger.appenderRefs=ar_console,ar_rolling
  7. rootLogger.appenderRef.ar_console.ref=StdoutAppender
  8. rootLogger.appenderRef.ar_rolling.ref=RollingAppender
  9. #Console Logger
  10. appender.a_console.type=Console
  11. appender.a_console.name=StdoutAppender
  12. appender.a_console.layout.type=PatternLayout
  13. appender.a_console.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
  14. #Rolling Logger
  15. appender.a_rolling.type=RollingFile
  16. appender.a_rolling.name=RollingAppender
  17. appender.a_rolling.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
  18. appender.a_rolling.fileName=log4j2/log4j2-test-automation.log
  19. appender.a_rolling.filePattern=log4j2-sample-%d{yyyy-MM-dd}.log
  20. appender.a_rolling.layout.type=PatternLayout
  21. appender.a_rolling.policies.type=Policies
  22. appender.a_rolling.policies.time.type=TimeBasedTriggeringPolicy
  23. appender.a_rolling.policies.time.interval=1
  24. # To change log file every day
  25. appender.a_rolling.policies.time.modulate=true
  26. # To change log file after 10MB size
  27. appender.a_rolling.policies.size.type=SizeBasedTriggeringPolicy
  28. appender.a_rolling.policies.size.size=10MB
  29. appender.a_rolling.strategy.type=DefaultRolloverStrategy
  30. appender.a_rolling.strategy.max=20