2 Answers
2

I must admit I don't fully understand your question, but maybe MDC in Log4J is what you need? Using some sort of aspect/filter/proxy you can assign key-value pairs to special thread-local MDC object provided by Log4J. Entries from this map can be retrieved and appended to every logging statement automatically.

This mechanism, since it is local to the running thread, is very often used to display current user name/session id in every logging statement occurring in a given thread, which is very handy.

the solution for seam application is that you need to extend the saem built in LoggingFilter and set the precedence of this filter to Install.APPLICATION, there in that filter you have the acces to MDC and you simply put other parameters in the MDC map ant then you call tihis parameters in the jboss-log4j.xml conf file on jboss server. The parametes shoud be referenced in the ConversionPattern param for example the patern must be %d{ABSOLUTE} %-5p [%c{1}] [%X{url}] - [%X{username}] %m%n", where %X{username} and %X{url} are parameters previously saved in MDC map
–
simonCAug 3 '11 at 17:36