Log4J Custom Fields

后端 未结 3 1688
再見小時候
再見小時候 2020-12-15 06:08

Introduction:

I\'m trying to get additional fields to log with log4j, and its working but only when I create an appender in code and not in the log4j.properties

3条回答
  •  青春惊慌失措
    2020-12-15 07:14

    Can it be that when you load via properties the AppServerPatternLayout is instantiated before the AppServerLoggerFactory is created? If you pick up the values of your custom fields at creation as opposed to at first use that could be an explanation.

提交回复
热议问题