AppD Archive

Log4j errors monitoring

CommunityUser
Splunk Employee
Splunk Employee

Hello,

I am trying to log errors sent by log4j but it doesn't seem to work whereas I correctly activated that feature in the viewer.

Should I add something on the log4j configuration of my apps ?

Then is it supposed to only report issues with the "ERROR" level or is it possible to customize that behaviour ?

Environment : appdynamics lite for java, tomcat 7.x, log4j 1.2.17

Thank you for your consideration.

Best regards,

Xavier

0 Karma

Arun_Dasetty
Super Champion

Hi Xavier,

Yes your understanding is right, currently we report error logged at "ERROR" or higher log level only, and we cannot customize this settings, however in pro version of the product though we do not show error transactions logged with lower than error level, we group log4j warnmessage and increase the count of this metric when there is load on BT that log warn messages

Let us know if that clarifies your queries.

Thanks,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Thank you for your answer, it is clear but is doesn't seem to work for me even for logs with ERROR level.

I have that code :

Logger.getLogger(FailAuthHandler.class).log(Level.ERROR, username + ":" + request.getParameter("j_password") + "@" + request.getRemoteAddr());

In my log file I have that record too :

2013-10-28 14:55:29,271 ERROR FailAuthHandler: - *****:******@127.0.0.1

But I don't see it in the viewer even after refreshing. Do you have any idea where I could look at to identify the issue ?

0 Karma

Arun_Dasetty
Super Champion

Hi Xavier,

Thanks for the update, we see that Lite supports log4j and java util logging and we see that we instrument severe log level or higher, as we could not locate "Level.ERROR" under class http://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html

Can you please try Level.SEVERE and also confirm whether you checked under snapshot -> summary -> error details section as listed in screenshot , and also let us the fully qualified class name and implementation of Logger and Level classes in test env.

image.png

image.png

We confirm the errors logged in Lite should be discovered as shown above

also can you try the following pattern and see if that helps:
LOGGER.error("error message, e.fillInStackTrace());

Keep us posted the requested information

Thanks,

Arun

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...