Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to enable debug logging for Cloudera Manager server

avatar
Expert Contributor

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

1 ACCEPTED SOLUTION

avatar
Master Guru

@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

 

 

View solution in original post

1 REPLY 1

avatar
Master Guru

@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