Reply
Expert Contributor
Posts: 90
Registered: ‎05-09-2017

How to enable debug logging for Cloudera Manager server

What changes do i need to make in /etc/cloudera-scm-server/log4j.properties  to view debug logs. 

Posts: 1,095
Topics: 1
Kudos: 278
Solutions: 132
Registered: ‎04-22-2014

Re: How to enable debug logging for Cloudera Manager server

@desind,

 

There are a few ways to enable DEBUG or TRACE depending on what sort of problem you are attempting to troubleshoot.

 

(1)

 

If CM won't start or if there is a problem where you do not have an idea what classes are involved, you can enable DEBUG or TRACE for the whole server.  Warning:  this can be very very verbose, so it is likely going to be difficult to capture an event.

 

- Edit /usr/sbin/cmf-server in CM 5--- Edit /opt/cloudera/cm/bin/cm-server in CM 6

- Change this:

export CMF_ROOT_LOGGER="INFO,LOGFILE"

to

export CMF_ROOT_LOGGER="DEBUG,LOGFILE"

 

Restart CM to have the change apply.

 

(2)

 

If you know what class or package you want to DEBUG, you can edit /etc/cloudera-scm-server/log4j.properties:

 

Add lines as follows... this is an example of turning on debugging for just ldap classes in SpringFramework (used in LDAP authentication):

 

log4j.logger.org.springframework.ldap=TRACE
log4j.logger.org.springframework.security.ldap=TRACE

 

Restart CM to have the changes apply

 

(3)

 

If you want to turn on some debug or trace level logging for just the current session of Cloudera Manager, you can use the debug page:

 

https://cm_host:cm_port/cmf/debug/logLevel

 

- Choose the Logger from the drop-down

- Select the level to which you want to change the logging

- Click "Submit Query" button to apply

 

The log level you selected will only apply until you restart Cloudera Manager

 

(4)

 

API debugging.

 

You can enable API debugging in the Cloudera Manager interface:

 

- Navigate to: Administration --> Settings

- Search for Enable Debugging of API

- Check the box next to it and Save

 

API debugging will be written to the /var/log/cloudra-scm-server/cloudera-scm-server.log file without restart.

 

(5)

 

NOTE:

 

If you do enable verbose debugging, you may need to increase the size of log files or the number to be able to review relevant lines.  To do so, I believe you can simply edit the following in /etc/cloudera-scm-server/log4j.properties:

 

log4j.appender.LOGFILE.MaxFileSize=10MB
log4j.appender.LOGFILE.MaxBackupIndex=10