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!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...