我有以下的附录布局:
log4j.appender.console.layout.ConversionPattern=%d{MM/dd/yyy HH:mm:ss} level='%-5p' node='%X{node}' channel='statistic' thread='%t' \
message='%m%n '在控制台中,我看到以下内容:
03/31/16 14:38:49 level='INFO ' node='' channel='statistic' thread='Scanner-2' message='Root WebApplicationContext: initialization started
'03/31/16 14:38:50 level='DEBUG' node='' channel='statistic' thread='Scanner-2' message='Adding [servletConfigInitParams] PropertySource with lowest search precedence
'03/31/16 14:38:50 level='DEBUG' node='' channel='statistic' thread='Scanner-2' message='Adding [servletContextInitParams] PropertySource with lowest search precedence
....我想避免以单引号开头的新行。此报价应放在前一行。
我怎样才能做到这一点?
发布于 2016-03-31 10:51:10
只需将消息模式更改为%m%n,或者如果您真正想要单引号,则可能更改为‘%m’‘%n
发布于 2016-03-31 10:48:05
消息格式使用的是一个新的行附录,但在此之后,您是否附加了单个引用.改为使用:
log4j.appender.console.layout.ConversionPattern=%d{MM/dd/yyy HH:mm:ss} level='%-5p' node='%X{node}' channel='statistic' thread='%t' \
message='%m'%nhttps://stackoverflow.com/questions/36331076
复制相似问题