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