Я пытаюсь сохранить сгенерированные системой журналы в файле Selenium.log и ручные журналы в файле Application.log. Log4j.properties выглядит следующим образом
#Root Logger option
log4j.rootLogger = debug, file
log4j.appender.file = org.apache.log4j.RollingFileAppender
log4j.appender.file.File = C:\\Users\\user\\eclipse-workspace\\DataDrivenFrameworkMaven\\src\\test\\resources\\logs\\Selenium.log
log4j.appender.file.maxFileSize = 5000KB
log4j.appender.file.maxBackupSize = 1
log4j.appender.file.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{5}:%L - %m%n
#Do not append the old file. Create a new log file everytime
log4j.appender.file.Append = false
#Application Logs
log4j.logger.devpinoyLogger = DEBUG, dest1
log4j.appender.dest1 = org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File= C:\\Users\\user\\eclipse-workspace\\DataDrivenFrameworkMaven\\src\\test\\resources\\logs\\Application.log
log4j.appender.dest1.maxFileSize = 5000KB
log4j.appender.dest1.maxBackupIndex = 3
log4j.appender.dest1.layout = org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern = %d{dd/MM/yyyy HH:mm:ss} %c %m%n
#Do not append the old file. Create a new file every time
log4j.appender.dest1.Append = false
Но в обоих файлах сохраняется только информация о ручном журнале. Сгенерированная системой информация журнала не сохраняется в файле Selenium.log. Вывод обоих файлов ниже:
application.log
14/11/2018 20:03:40 devpinoyLogger Config file is loaded.
14/11/2018 20:03:40 devpinoyLogger OR file is loaded.
14/11/2018 20:03:43 devpinoyLogger Chrome browser is launched.
14/11/2018 20:03:49 devpinoyLogger Navigted to http://www.way2automation.com/angularjs-protractor/banking/#/login
14/11/2018 20:03:49 devpinoyLogger Inside Login Test
14/11/2018 20:03:49 devpinoyLogger Login Test successfully executed
14/11/2018 20:03:50 devpinoyLogger Test execution completed
Selenium.log
20:03:40,725 DEBUG devpinoyLogger:40 - Config file is loaded.
20:03:40,728 DEBUG devpinoyLogger:53 - OR file is loaded.
20:03:43,330 DEBUG devpinoyLogger:61 - Chrome browser is launched.
20:03:49,129 DEBUG devpinoyLogger:74 - Navigted to http://www.way2automation.com/angularjs-protractor/banking/#/login
20:03:49,161 DEBUG devpinoyLogger:13 - Inside Login Test
20:03:49,305 DEBUG devpinoyLogger:16 - Login Test successfully executed
20:03:50,326 DEBUG devpinoyLogger:87 - Test execution completed