Got it working by using the parameter name instead of just %X, so %X{trace.id}. This is with the jboss logmanager and logging domain.
<subsystem xmlns=""urn:jboss:domain:logging:1.1">
.
.
.
.
<periodic-rotating-file-handler name="FILE">
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] apmtrace [traceid %X{trace.id} transactionid %X{transaction.id}] (%t) %s%E%n"/>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
.
.
.
In terms of the docs I am curious about what happens behind the scenes (the mechanics of how the log correlation works)