How do I reduce the log level of Candlepin?

Latest response

We get gigas of log entries to /var/log/candlepin/candlepin.log, mostly just stuff like:

2017-04-03 10:05:22,332 [thread=http-bio-8443-exec-4] [req=243254b6-9d7e-487b-a51e-34253384fe86, org=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/consumers/e4cd05e3-39ae-4ea1-a2e8-4f29604a07f2/compliance
2017-04-03 10:05:22,379 [thread=http-bio-8443-exec-7] [req=f0bd5fca-f22d-468b-9ba3-712461d2fd22, org=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/consumers/2b316c03-6733-4527-acfe-f13c48507bcc/guests

...etc...etc...

The info at Red Hat Satellite 6: key log files and how to enable debug logging (Foreman, Katello, Puppet, Pulp, Candlepin, Hammer, etc.) tells us we can change to log4j.logger.org.candlepin=DEBUG to get more logging, and also says we can add this if the logging is excessive:

log4j.logger.org.candlepin.resource.ConsumerResource=WARN
log4j.logger.org.candlepin.resource.HypervisorResource=WARN

I have done so and restarted Tomcat (actually restarted all using katello-service), but still get the INFO lines like above.

I assume we can change to log4j.logger.org.candlepin=WARN to reduce the log size. However, if I only want to get rid of the INFO messages above and keep other INFO messages. What do I do? I thought the... ConsumerResource=WARN above should do the trick, but I don't understand the common logging filter thing.

Responses

Tried log4j.logger.org.candlepin=INFO?

DEBUG level increases logging which is ideal for troubleshooting. Ideally, it should not be on permanently. More on log4j levels

Maybe I wasn't clear... it is the two WARN lines above I have added, not the DEBUG example.

I believe INFO is default when nothing is specified, and is what we have been running with, which gives too much logging.

I might try log4j.logger.org.candlepin=WARN this afternoon, but my question is about how can I stop logging all the GET /candlepin/consumers/... INFO entries without stopping INFO entries from other modules.

Hi Terje,

The logging level you set applies to all Candlepin logs. Filters such as log4j.logger.org.candlepin.resource.ConsumerResource enable you to have a different logging level just for that resource.

I ended up putting this in:

log4j.logger.org.candlepin.resource.ConsumerResource=INFO
log4j.logger.org.candlepin.resource.HypervisorResource=INFO
log4j.logger.org.candlepin=WARN

This removes the excessive logging, but I still get the INFO messages I want, e.g. for the hypervisors

Good you got it working.

Actually, ended up with just this, that let the other components stay at the default INFO level:

# 2017-04-02 tertra: INFO logget too much, had to change it to WARN
# Note: Will lose e.g.: "Response: status=400" messages.
#
# Ref: https://access.redhat.com/solutions/1155573
#
log4j.logger.org.candlepin.common.filter.LoggingFilter=WARN
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.