Answer the question
In order to leave comments, you need to log in
Test execution logging, in a separate file?
Good afternoon.
I just can't figure out how to configure log4j2 to output the log to a separate file for each test class.
There is log4j2, Google did not give any results.
The tests are run in parallel.
Requires that the execution of each test class be written to a separate file.
I will be glad for any hint.
Thank you.
Answer the question
In order to leave comments, you need to log in
well, I would do this option:
https://stackoverflow.com/questions/8965946/config...
FileAppender fa = new FileAppender();
fa.setName("FileLogger");
fa.setFile("mylog.log");
fa.setLayout(new PatternLayout("%d %-5p [%c{1}] %m%n"));
fa.setThreshold(Level.DEBUG);
fa.setAppend(true);
fa.activateOptions();
//add appender to any Logger (here is root)
private final Logger logger = Logger.getRootLogger().addAppender(fa);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question