Hi,
I have the Java logging sensor enabled and am able to see entries in the logging dashlet as well as the purepaths, however the Message field does not tell me anything about the error, only specifying the logging class (for example, util.logging.Log$LoggingParameters@3d54af1b).
I'm not able to make any change to the logging sensor configuration, is there somewhere else (within dynatrace or the application/log4j) where this needs to be configured?
Thanks,
Dwayne
Answer by Christian S. ·
hi Dwayne,
it's exactly as I previously assumed: you're using ca.tdbank.util.logging.TDLog$LoggingParameters objects for your log4j logging. the logging sensor will not be able to render them as it only calls toString() on those objects.
so if you implement a toString() method on those objects with the information you want to see, you will be fine.
if that's not possible you could place a custom sensor on this method:
forcedLog(java.lang.String fqcn, org.apache.log4j.Priority level, java.lang.Object message, java.lang.Throwable t)
... then capture the message object and call an accessor method (for more information see here: https://community.dynatrace.com/community/display... on this object. however, that assumes that there is already a method in the ca.tdbank.util.logging.TDLog$LoggingParameters class that gives you the information you need.
and also this approach has the drawback, that you want have this information in the logging dashlet, but just in the PurePath dashlet.
HTH, Christian
Answer by Dwayne F. ·
I've attached a purepath that contains the issue, I've also attached a screenshot showing what's being captured in the Logging dashlet.
-Dwayne
Answer by Christian S. ·
hi Dwayne,
do you have a PurePath to share with us?
right now I only have an assumption: I guess you're not using plain strings when logging to log4j, but specific objects, that you implemented on your own (e.g. util.logging.Log$LoggingParameters). based on a short research I figured that you can provide Renderers to log4j to correctly render such log objects.
however, our logging sensor only calls toString() on such log objects and does not use such Renderers.
so one simple approach would be that you add a toString() method to your log objects (assumingly util.logging.Log$LoggingParameters).
HTH, Christian
JANUARY 15, 3:00 PM GMT / 10:00 AM ET