Page 1 of 1

Multiple Server Trace Handlers

Posted: Wed Dec 27, 2017 9:32 am
by jyoung
I have multiple Server Trace Handlers that implement #PRIM_APP.iTraceHandler.

Each one is for a different "application" we have in the Partition and they write to different text/log files. One is a generic trace handler that is used in common / shared server side components such as our LDAP Functions.

I declare the handlers in the component (such as a Server Module) in application scope as such:

Code: Select all

define_com class(#PTOServerTraceHandler) scope(*APPLICATION)
When I have one handler declared in a Server Module and the "Generic" handler declared in a Function, that is invoked by the Server Module, the two handlers seem to be getting "crossed".

Debugging BOTH handlers, show both are getting initialized BUT ALL trace messages are going to the generic handler instead of the handler that was declared in the component.

Further debugging shows that the handler declared in the Server Module is initialized first and the generic handler in the Function is initialized second.

I would expect that the trace messages in the Server Module would go to the handler declared in the Server Module and that trace messages declared in the Function would go to the handler declared in the Function, but this makes me think that the "last one initialized wins?"

Anybody else experience this? Is there anyway to get this to work as described or am I stuck with only one trace handler?