开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜