开发者

What is the length of Java log4j's log message's max length? How to print it in a single line?

开发者 https://www.devze.com 2022-12-29 22:43 出处:网络
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 li

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 whatev开发者_如何转开发er the length of each log message has.


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.


It will limit the line size to 1000 charactors.

0

精彩评论

暂无评论...
验证码 换一张
取 消