I think you want a Mapped Diagnostic Context (MDC) which lets you add name-value pairs in thread specific storage that you can access in the log.
http://logging.apache.org/log4cxx/apidocs/classlog4cxx_1_1_m_d_c.html On Sun, Mar 15, 2009 at 4:00 PM, Rodolfo Gonzalez <rgonzale...@yahoo.com>wrote: > > Hi all, > We've been using the log4cxx library for a while in our applications. Then > we had this new requirement to add some new unsupported fields in the log. > After some research we were unable to find any documentation on the subject > so we had to look at the code and try to come up with a solution. We impose > yet another requirement on ourselves that is; not to change the library > code and make the code as > generic as possible. > > Then we decided to publish the solution in the hope somebody might find it > useful. It can be found here: > > > http://rodolfotech.blogspot.com/2009/03/adding-new-fields-to-log4cxx-logger.html > > I don't know if this is the best way to do it works for us. Any alternative > approach will be highly appreciated. > > Many thanks, > > RODOLFO > > > > -- Dale King