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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...