gstackoverflow
gstackoverflow

Reputation: 37034

New log line starts with single quote

I have the following appender layout:

log4j.appender.console.layout.ConversionPattern=%d{MM/dd/yyy HH:mm:ss} level='%-5p' node='%X{node}' channel='statistic' thread='%t' \
  message='%m%n '

in console I see following:

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

I want to avoid that new line starts with single quote. this quote should be placed on previous line.

How can I achieve it?

Upvotes: 1

Views: 65

Answers (2)

Paolo Bernardi
Paolo Bernardi

Reputation: 101

Just change the message pattern to %m%n, or perhaps '%m'%n if you really want the single quotes

Upvotes: 1

The message format is using a new line appender but after that are you appending the single quoute... use instead:

log4j.appender.console.layout.ConversionPattern=%d{MM/dd/yyy HH:mm:ss} level='%-5p' node='%X{node}' channel='statistic' thread='%t' \
  message='%m'%n

Upvotes: 2

Related Questions