Managing Cloudera Manager Server Logs

You can use the Cloudera Manager Server logs to troubleshoot problems with Cloudera Manager .

Viewing the Cloudera Manager Server Logs

To help you troubleshoot problems, you can view the Cloudera Manager Server log. You can view the logs in the Logs page or in specific pages for the log.

  1. In the left menu, click Diagnostics > Logs.
  2. Next to Sources, select the Cloudera Manager Server checkbox and deselect the other options.
  3. Adjust the search criteria and click Search.

You can also view the raw Cloudera Manager Server log by logging in to the Cloudera Manager Server host and view the /var/log/cloudera-scm-server/cloudera-scm-server.log file.

Setting the Cloudera Manager Server Log Location

You can customize the location of the Cloudera Manager Server log files.

Depending on your requirements, choose one of the following methods:

  • Log-Only Relocation (Recommended): Changes only the log directory path (for example, to /var/log/custom/cloudera-scm-server) without modifying operational state or run directories.

  • Broad Directory Relocation: Changes the parent directory for both logs and operational run directories using the CMF_VAR variable.

Option 1: Relocating only the Cloudera Manager Server Logs (Recommended)
To change the log directory location without altering other operational paths, you can either move your existing log directory to the new location or create a new directory from scratch:
Method A: Moving the existing Log Directory (Preserves existing Logs)
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Move the existing log directory to your preferred target location:
    sudo mv /var/log/cloudera-scm-server /var/log/custom/cloudera-scm-server
  3. Open /etc/default/cloudera-scm-server in a text editor and configure the custom log path by appending the -Dcmf.log.dir system property to CMF_JAVA_OPTS:
    export CMF_JAVA_OPTS="$CMF_JAVA_OPTS -Dcmf.log.dir=/var/log/custom/cloudera-scm-server"
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-server
  5. Verify that the Cloudera Manager Server log files are actively being written to your new custom directory:
    ls -l /var/log/custom/cloudera-scm-server/cloudera-scm-server.log
Method B: Creating a new Custom Log Directory
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Create your custom log directory and set ownership to cloudera-scm:
    sudo mkdir -p /var/log/custom/cloudera-scm-server
    sudo chown -R cloudera-scm:cloudera-scm /var/log/custom/cloudera-scm-server
  3. Open /etc/default/cloudera-scm-server in a text editor and configure the custom log path by appending the -Dcmf.log.dir system property to CMF_JAVA_OPTS:
    export CMF_JAVA_OPTS="$CMF_JAVA_OPTS -Dcmf.log.dir=/var/log/custom/cloudera-scm-server"
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-server
  5. Verify that the Cloudera Manager Server log files are actively being written to your new custom directory:
    ls -l /var/log/custom/cloudera-scm-server/cloudera-scm-server.log
Option 2: Relocating the Parent Variable Directory (CMF_VAR)
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Move or copy the existing log and run directories to the new base location (for example, /opt) to retain state and existing log files, or create new directories and assign ownership:
    sudo mkdir -p /opt/log/cloudera-scm-server
    sudo mkdir -p /opt/run/cloudera-scm-server
    sudo chown -R cloudera-scm:cloudera-scm /opt/log /opt/run
  3. Open /etc/default/cloudera-scm-server in a text editor and set the CMF_VAR environment variable to the new parent directory:
    export CMF_VAR=/opt
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-server

Configuring Cloudera Manager Server log retention

You can customize the maximum file size and the number of backup log files retained for Cloudera Manager Server logs by modifying the /etc/cloudera-scm-server/log4j.properties configuration file.

Cloudera Manager Server log appenders
Cloudera Manager Server uses specific Log4j appenders to manage its log output files:
Log appender Associated log file Default MaxFileSize Default MaxBackupIndex Description
LOGFILE cloudera-scm-server.log 10MB 10 Main Cloudera Manager Server log file.
JETTYLOG cmf-server--nio.log 10MB 10 Embedded Jetty web server access and operational logs.
PERFLOGFILE cmf-server-perf.log 10MB 10 Performance metrics and execution timing logs.
CG1 cloudera-scm-server-gc.log 10MB 1 Garbage Collection (GC) logging output.
MEMFILE cmf-server-memory.log 10MB 10 Memory usage and heap tracking logs.
Modify log retention parameters

Perform the following steps to configure maximum file sizes and retention limits in the /etc/cloudera-scm-server/log4j.properties configuration file:

  1. Log in to the Cloudera Manager Server host through SSH.
  2. Open the /etc/cloudera-scm-server/log4j.properties configuration file in a text editor:
    sudo vi /etc/cloudera-scm-server/log4j.properties
  3. Locate the appender properties you want to modify and update the MaxFileSize (file size before rollover) and MaxBackupIndex (number of rotated log files to retain):
    # Main Server Log (cloudera-scm-server.log)
    log4j.appender.LOGFILE.MaxFileSize=20MB
    log4j.appender.LOGFILE.MaxBackupIndex=15
    
    # Jetty Web Server Log (cmf-server--nio.log)
    log4j.appender.JETTYLOG.MaxFileSize=10MB
    log4j.appender.JETTYLOG.MaxBackupIndex=10
    
    # Performance Log (cmf-server-perf.log)
    log4j.appender.PERFLOGFILE.MaxFileSize=10MB
    log4j.appender.PERFLOGFILE.MaxBackupIndex=10
    
    # Garbage Collection Log
    log4j.appender.CG1.MaxFileSize=10MB
    log4j.appender.CG1.MaxBackupIndex=2
    
    # Memory Tracking Log (cmf-server-memory.log)
    log4j.appender.MEMFILE.MaxFileSize=10MB
    log4j.appender.MEMFILE.MaxBackupIndex=10
  4. Save and close the file.
  5. Restart the Cloudera Manager Server daemon to apply the changes:
    sudo systemctl restart cloudera-scm-server