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
From the example you posted, I can only guess that AppServerPatternLayout is not in the package logging. Everything else looks find. Add
log4j.DEBUG=true
to your properties file. log4j will then dump what it does while reading the properties. Maybe that gives you an idea what's wrong.
If that doesn't help, consider to use Nested Diagnostic Contexts.