Changing logging locations

Logging locations for DataStax Enterprise (DSE) are set at installation. Generally, the default logs location is /var/log. For example, /var/log/cassandra and /var/log/tomcat.

To change logging locations after installation, do the following:

  1. Update the log directory location in the dse-env.sh file or the logback.xml file.

    To generate all logs in the same location, update the dse-env.sh file. To generate logs in separate locations, update the logback.xml file.

    • dse-env.sh

    • logback.xml

    Add CASSANDRA_LOG_DIR to the dse-env.sh file:

    export CASSANDRA_LOG_DIR="LOG_DIRECTORY_PATH"

    Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    Where is the dse-env.sh file located?

    The location of the dse-env.sh file depends on your installation type:

    • Package installations and installer-services installations: /etc/dse/dse-env.sh

    • Tarball installations and installer-no services installations: INSTALLATION_LOCATION/bin/dse-env.sh

    Replace ${cassandra.logdir} with the absolute path to your preferred log directory in both the <file> and <fileNamePattern> elements for each appender.

    The ${cassandra.logdir} variable appears in the following locations:

    • SYSTEMLOG appender: Controls system.log and its archived files

    • DEBUGLOG appender: Controls debug.log and its archived files

    • AUDIT appender: Controls audit.log and its archived files (if uncommented)

    Change the system.log location
    <!-- Before -->
    <file>${cassandra.logdir}/system.log</file>
    <fileNamePattern>${cassandra.logdir}/system.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
    
    <!-- After -->
    <file>LOG_DIRECTORY_PATH/system.log</file>
    <fileNamePattern>LOG_DIRECTORY_PATH/system.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>

    Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    Change the debug.log location
    <!-- Before -->
    <file>${cassandra.logdir}/debug.log</file>
    <fileNamePattern>${cassandra.logdir}/debug.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
    <!-- After -->
    <file>LOG_DIRECTORY_PATH/debug.log</file>
    <fileNamePattern>LOG_DIRECTORY_PATH/debug.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>

    Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    Change the audit.log location
    <!-- Before -->
    <file>${cassandra.logdir}/audit.log</file>
    <fileNamePattern>${cassandra.logdir}/audit.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
    <!-- After -->
    <file>LOG_DIRECTORY_PATH/audit.log</file>
    <fileNamePattern>LOG_DIRECTORY_PATH/audit.log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>

    Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    Where is the logback.xml file located?

    The location of the logback.xml file depends on the type of installation:

    • Package installations and installer-services installations: /etc/dse/cassandra/logback.xml

    • Tarball installations and installer-no services installations: INSTALLATION_LOCATION/resources/cassandra/conf/logback.xml

    To use different directories for different log types (system, debug, audit), specify different paths for each appender.

  2. Optional: Change the Tomcat server log locations for DSE Search.

    To generate all logs in the same location, update the cassandra-env.sh file. To generate logs in separate locations, update the logging.properties file.

    • cassandra-env.sh

    • logging.properties

    Update the TOMCAT_LOGS environment variable:

    export TOMCAT_LOGS="LOG_DIRECTORY_PATH"

    Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    Where is the cassandra-env.sh file located?

    The location of the cassandra-env.sh file depends on the type of installation:

    • Package installations and installer-services installations: /etc/dse/cassandra/cassandra-env.sh

    • Tarball installations and installer-no services installations: INSTALLATION_LOCATION/resources/cassandra/conf/cassandra-env.sh

    1. Set the locations in the resources/tomcat/conf/logging.properties file by replacing ${tomcat.logs} with the path to your log directory:

      1catalina.org.apache.juli.AsyncFileHandler.level = FINE
      1catalina.org.apache.juli.AsyncFileHandler.directory = LOG_DIRECTORY_PATH
      1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
      
      2localhost.org.apache.juli.AsyncFileHandler.level = FINE
      2localhost.org.apache.juli.AsyncFileHandler.directory = LOG_DIRECTORY_PATH
      2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
      
      3manager.org.apache.juli.AsyncFileHandler.level = FINE
      3manager.org.apache.juli.AsyncFileHandler.directory = LOG_DIRECTORY_PATH
      3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
      
      4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
      4host-manager.org.apache.juli.AsyncFileHandler.directory = LOG_DIRECTORY_PATH
      4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
      
      java.util.logging.ConsoleHandler.level = FINE
      java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter

      Replace LOG_DIRECTORY_PATH with the absolute path to your preferred log directory.

    2. Save the changes to the logging.properties file.

  3. Restart DSE.

  4. Go to your log directory and verify that DSE is writing logs to the new location.

See also

If you use OpsCenter, you can change logging locations for DSE using configuration profiles.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2025 | Privacy policy | Terms of use Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM