Multiple Server Trace Handlers

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Multiple Server Trace Handlers

Post 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?
Post Reply