In my program, I have 2 different streams of logging events (for simplicity, they are called streams, in fact its 2 Epander). Stream logging and stream logging in Stream 2 are included now, it may seem easy, except that some class clients may be in logging and server logging, depending on the situation. The fact of taking this forward is that a command that a customer wants is in 2 different threads (randomly being obtained from a thread pool), so any kind of tracking possible with MDC or NDC is not.
What is really simple about this, if the logger adopters can get calls from example , in this way I can set up 2 attenders for 2 loggers and done Will go However, I do not know how to do it cleanly or easily, can anyone suggest how to do this?
Note: If something has to be passed, then I have an event bean which goes to everything in the series which can be used if necessary. / P>
You have already mentioned that client processing occurs in multiple threads, so a simple threadlocal
The approach can not work ... but will thread group local
work?
See [
The only suggestion I give is that the appender registered with the appendix logging framework will have to write to you the implementation threadlocal / threadgroup local appender. That will be an Appender-client-or control-specific.
Also keep in mind that your appendor should not be configured under asynchronous or batching abstraction.
Comments
Post a Comment