I have an ASP.NET website and I am doing logging with log4net. As logging requirements change often, I want to enable PMs to modify the information that gets logged and also to be able to log extra information for debugging in production (i.e without having to recompile)
My plan is to expose certain values to log4net, for example the GET / POST params from context. To log such a param, the user would just go to the log4net config and do something like %message{userId}
I have found a way to do it using a property bag on log4net.ThreadContext but I am not sure if this doesn't have side-effects, i.e. the values are persisted for too long.
Another way is to use a forwarding appender, and inject the extra values whenever the logger gets called, but I haven't been able to implement this, there are not enough examples out there.
Any ideas?