Reputation: 31
After executing the test cases, all the log steps will be written into a file. Like as shown below.
[INFO ][2014-04-16 16:49:02,945] - Reading data properties from dataSource file
[INFO ][2014-04-16 16:49:02,945] - DataSource.properties file path
[INFO ][2014-04-21 08:08:27,134] - Reading data properties from dataSource file [INFO ][2014-04-21 08:08:27,135] - DataSource.properties file path
In Jenkins, after completing the first log statement, second statement will be added to it. But my requirement is first statement in first line, second statement in second line. So how can I specify the next line character in Log4j?
Upvotes: 2
Views: 1203
Reputation: 5628
In Log4j (v1 or v2), you can use %n
in your PatternLayout
to insert the new line character.
You can read more about Log4j patterns here:
Here are Log4j configurations examples:
log4j.appender.FileAppender.layout.ConversionPattern=%-5p [%t] %m%n
<PatternLayout pattern="%-5p [%t] %m%n"/>
Upvotes: 1