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
Hi Adam,
Can you please config as referred in below screenshot and see if that helps:
and save the chnages and check for new load on BT raising error.
Regards,
Arun
But sometimes there can be 3 Objects after the String and sometimes 4, or 5, etc. Will this work for all possibilities?
Thanks,
Adam
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
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
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.