In log4j default logging configuration, each line of log message which is printed in server log has maximum length comes around 8221 characters. If it exceeds this length, it is printed in multiple lines. But I want to print it in a single line, though whatever the length of each log message has.
The process of creating a new Logger in Java is quite simple. You have to use Logger. getLogger() method. The getLogger() method identifies the name of the Logger and takes string as a parameter.
To get log print in a single line, What I did is, I configured PatternLayout like value="%m%n", without configuring date format and etc..
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%m%n"/>
</layout>
This is what my need & get solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With