Remove Thread and category column in log4j html lo

2019-09-15 03:08发布

i am generating html format log output using log4j, but i want to output only Time Level and Message Column in it. how to format it in properties file?? do we need any things to be coded also?? please help.

log4j.appender.HA=org.apache.log4j.FileAppender
log4j.appender.HA.File=c://Test_Log/Test_Log.html
log4j.appender.HA.layout=org.apache.log4j.HTMLLayout
log4j.appender.HA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

help me... thanks all

2条回答
闹够了就滚
2楼-- · 2019-09-15 03:35

HTML layout doesn't look like it has a ConversionPattern

查看更多
可以哭但决不认输i
3楼-- · 2019-09-15 03:49

According to the documentation:

  • %c is the category
  • %t is the thread info

Remove those from your pattern:

log4j.appender.HA.layout.ConversionPattern=%-4r %-5p %x - %m%n
查看更多
登录 后发表回答