We use slf4j for logging. How do I make those log messages appear on "Logging" dashlet?
I tried the following: I set sensor on org.slf4j.impl.KernelLoggerAdapter class's all methods. And I added an entry to "Sensor Configuration" for that slf4j. This didn't make any messages show up in the dashlet.
thanks
veera
Answer by Christian S. ·
just to be sure, so what you have configured in the Java JDK Logging and Log4J Properties is:
in this case you should get all log statements which contain 'ERROR' as severity.
so question #1 to me is: do you really have such error log statements (or is everything just running fine)?
and additionally i'm wondering: you know that you will only get log statements that are logged in the context of your PurePaths, right?
so question #2 to me is: if you have such log statements, are they happening in the context of your PurePaths?
so IMHO you should do the following, at least temporarily:
you can then also share a session with some of the resulting PurePaths here, so we can take a look at it.
hope this helps,
Christian
Answer by Veera B. ·
Good catch Christian.
Underneath it we use Log4j, i double checked in the debugger. So then i wonder why it is still not working.
"Java jdk Logging and Log4j" sensor pack is enabled. Its "Sensor Configuration" has an entry with Severity=ERROR and match="contains". Classname="" and match="start".
And I have error detection rule with below settings:
"treat log message as ....." contains = "ERROR"
Log message (checkbox checked) with contains = "|ERROR|"
Do you see anything wrong with above.
Answer by Christian S. ·
hi Veera,
SLF4J is not a logging framework itself, but just an abstraction layer using another logging framework underneath.
do you happen to know which logging framework this is in your case?
best,
Christian
Answer by Andreas G. ·
In order for dynaTrace to capture log information that will then show up in the Logging Dashlet it needs specific support for this logging framework through the Java Logging Sensor Pack. Right now slf4j is not supported. You have posted a link to this question on two other posts - one of them is an RFE (Request for Enhancement) where you should make sure you click on VOTE UP so that we know how many people demand that feature
Right now - your approach will not work as you have it in mind. What you can do is to define a sensor rule for the individual logging methods and capture the method argument value that contains the log message. You will then see the log message capture as regular method argument in your PurePath
Andi
JANUARY 15, 3:00 PM GMT / 10:00 AM ET