简体   繁体   中英

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 whatever 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.

它会将行大小限制为1000个字符。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM