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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...