AppD Archive

How do I configure error detection for errors logged with slf4j?

CommunityUser
Splunk Employee
Splunk Employee

Hi,

I'd like to have appdynamics detect errors when I log them with slf4j. However, when on the screen to define a custom logger it needs you to define all the parameters and say which one contains the exception. That's a problem with slf4j as it uses varargs, so there is not a set number of parameters, all we know is that the last one is the exception. See http://www.slf4j.org/api/org/slf4j/Logger.html#error(java.lang.String, java.lang.Object...) How can I configure this with AppDynamics?

Thanks,

Adam

0 Karma

Arun_Dasetty
Super Champion

Hi Adam,

Can you please config as referred in below screenshot and see if that helps:

image.png

and save the chnages and check for new load on BT raising error.

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

But sometimes there can be 3 Objects after the String and sometimes 4, or 5, etc. Will this work for all possibilities?

Thanks,

Adam

0 Karma

Arun_Dasetty
Super Champion

Hi Adam,

It worked for similar case for one of the customer, and if that does not work we might need to define more parameters for vararg object like we suggest earlier.

Can you give a try using java.lang.Object[] syntax and see if that helps ?

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

I don't think the Object[] is working. SLf4j (and logback) are really popular and used by many framworks. Can you add slf4j support in the same fashion as your log4j support, i.e. just add a checkbox?

Thanks!

Adam

0 Karma

Arun_Dasetty
Super Champion

Hi Adam,

Agree, hence considering customer requests and slf4j high usage, we have added support in recent versions from 4.x version as stated in doc  https://docs.appdynamics.com/display/PRO40/Java+Supported+Environments#JavaSupportedEnvironments-Bus... section, out of box support for "Simple Logging Facade for Java (SLF4J)"

If the default pattern does not still help send the agent logs for 4.x version and also provide details of the API and method signature used to log error so that we will check in agent BCT.logs if issue persists still, Hope that information helps.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...