From 5c058d8f8515771148b4b639f9f1af20ca73e0e4 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Tue, 28 Jan 2020 12:02:56 +0400 Subject: [PATCH] Cleanup code (added logs rotation to tests) --- .gitignore | 3 +++ Mage.Tests/src/test/resources/log4j.properties | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8eac6b641f..655278e3e1 100644 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,9 @@ Mage.Verify/*.zip Mage.Verify/*.json Mage.Verify/db +# Logs rotation +*.log.* + # Utils releases Utils/author.txt diff --git a/Mage.Tests/src/test/resources/log4j.properties b/Mage.Tests/src/test/resources/log4j.properties index 961867c59b..e3edadcf93 100644 --- a/Mage.Tests/src/test/resources/log4j.properties +++ b/Mage.Tests/src/test/resources/log4j.properties @@ -1,7 +1,7 @@ #default settings (uses for TESTS run) #default log level and active appenders (dest for logs) -log4j.rootLogger=info, console, logfile, watchdog +log4j.rootLogger=info, console, logfileByIndex, watchdog #custom log level for java classes log4j.logger.com.j256.ormlite=warn @@ -20,6 +20,15 @@ log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} log4j.appender.logfile.File=magetest.log log4j.appender.logfile.Threshold=info +#file log - rolling by index +log4j.appender.logfileByIndex=org.apache.log4j.RollingFileAppender +log4j.appender.logfileByIndex.layout=org.apache.log4j.PatternLayout +log4j.appender.logfileByIndex.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n +log4j.appender.logfileByIndex.File=magetest.log +log4j.appender.logfileByIndex.MaxFileSize=10MB +log4j.appender.logfileByIndex.MaxBackupIndex=3 +log4j.appender.logfileByIndex.append=true + #file log - errors only log4j.appender.watchdog=org.apache.log4j.FileAppender log4j.appender.watchdog.layout=org.apache.log4j.PatternLayout