Manage Control Center Logs for Confluent Platform

Use this topic to enable and manage logs for Control Center.

Control Center logging

Control Center and other Confluent Platform components use the Java-based logging utility Apache Log4j to collect runtime data and record component events. The following table describes each log level. The Control Center Log4j properties file is located in the Confluent Platform installation directory path etc/confluent-control-center/

Level Description
OFF Turns off logging.
FATAL Severe errors that cause premature termination.
ERROR Other runtime errors or unexpected conditions.
WARN Runtime situations that are undesirable or unexpected, but not necessarily wrong.
INFO Runtime events of interest at startup and shutdown.
DEBUG Detailed diagnostic information about events.
TRACE Detailed diagnostic information about everything.

By default, Control Center writes INFO, WARN, ERROR, and FATAL information to standard output (stdout). If you want to see all events, you can set DEBUG or TRACE logging levels.

Confluent also provides etc/confluent-control-center/ as an example of setting up Control Center with rolling log files that are easier to manage. You can select your desired log4j configuration by setting the CONTROL_CENTER_LOG4J_OPTS environment variable when starting Control Center.

Log4j property files

A default Control Center Log4j template file is provided with Confluent Platform. This properties file is located in the Confluent Platform directory etc/confluent-control-center/

The following shows an example of what the default log file contains:

log4j.rootLogger=INFO, stdout

log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n

Confluent also provides etc/confluent-control-center/ as an example of setting up Control Center with rolling log files that simplify log management. The rolling log file creates three, size-limited log files that isolate information:

  • control-center.log - Control Center, HTTP activity, anything not related to streams, REST API calls
  • control-center-streams.log - Streams
  • control-center-kafka.log - Client, ZooKeeper, and Kafka

The following shows an example of what the rolling log file contains:

# this is a sample log4j config that will roll log files
# lines with `File=` may need to be updated for your environment

log4j.rootLogger=INFO, main

# c3
log4j.appender.main.layout.ConversionPattern=[%d] %p [%t] %m (%c)%n

# streams
log4j.appender.streams.layout.ConversionPattern=[%d] %p [%t] %m (%c)%n
# will allow everything that is >=level
# will only allow rate/second logs at <level
log4j.appender.streams.filter.1.rate=25, streams, streams

# kafka
log4j.appender.kafka.layout.ConversionPattern=[%d] %p [%t] %m (%c)%n

log4j.logger.kafka=INFO, kafka
log4j.additivity.kafka=false, kafka, kafka, kafka

You can add additional entries and change log levels by updating these configuration files.

If you are using Ansible Playbooks for Confluent Platform, use the variable control_center_log_dir to write Control Center logs to a custom directory. For more information, see Ansible Playbooks for Confluent Platform.

Enable logs for Control Center

You set your logging configuration with a Control Center environment variable at start up. Use the following environment variable to log4j configuration:


To set the logging configuration for Control Center:

  • Set and export the CONTROL_CENTER_LOG4J_OPTS environment variable similar to this example:

    export CONTROL_CENTER_LOG4J_OPTS='-Dlog4j.configuration=file:etc/confluent-control-center/<>'

You must restart Control Center to apply changes to logging with an environment variable. For more information, see Restarting Control Center.

Change log levels for Control Center

You can change log levels to help debug issues. The following commands show how to set root logging levels to DEBUG or TRACE.

  • To enable debug logging, change the log level to DEBUG at the root level:

    log4j.rootLogger=DEBUG, stdout
  • To enable trace logging, change the root logger to TRACE at the root level:

    log4j.rootLogger=TRACE, stdout

When you are done debugging and tracing, reset the log levels back to their defaults and restart Control Center. For more information, see Restarting Control Center.