Skip to main content

Working with the Log File

Logging settings are normally configured during installation to use logrotate so that log files do not grow too large.

Rolling the Log File Manually

Follow these steps to manually roll the log file (example assumes /var/log/aerospike/aerospike.log is the configured log file):

  1. Move the existing log file to a new location:

    $ sudo mv /var/log/aerospike/aerospike.log [file path]
  2. Find the server's (asd) process ID:

    $ pidof asd

    In non-systemd environments it can also be found in the pidfile:

    $ cat /var/run/aerospike/
  3. Send SIGHUP to the server (the asd process):

    $ sudo kill -s SIGHUP [asd process id]

    In the log file you will see a message saying:

    SIGHUP received, rolling log

Log messages up through the "SIGHUP received, rolling log" message will appear in the file at the new location specified by the mv command in step #1. Subsequent log messages will be written to a new /var/log/aerospike/aerospike.log file.

Determining the Log ID and the Location of the Log File

Occasionally, it might be necessary to change the log levels of different units during cluster use. Aerospike supports changing these parameters dynamically though scripted API calls using asinfo. Changing these settings does not require a server or cluster restart.

To determine where the log file is located use the command:

$ asinfo -h -p 3000 -v "logs"

This command returns the logs that are configured and their IDs and the output looks something like this:

value is  0:/var/log/aerospike/aerospike.log

At the present, only one log is used, log 0. If using using asinfo to change logging levels, specify log 0. If using asadm, specify /var/log/aerospike/aerospike.log.

Changing the Location of the Log File

To change the default location of the log file, you must modify the configuration settings.

Changing Logging Levels


Tools package 6.0.x or later is required to use asadm's manage config logging command. Otherwise, use the equivalent asinfo - log-set command.

The log levels are described in the SEVERITY LEVELS section of the Log Reference.

To determine the current logging levels use the command:

$ asinfo -h -p 3000 -v "log/0"

At the present, only one log is used, log 0. In the command above, log/0 refers to log ID 0.

This command returns the log contexts and their current levels. This example shows the default log level CRITICAL.


Typically all contexts are set to INFO to minimize excess logging.

For suported severity levels, see the context configuration parameter.

To change the logging level use a command like the one below. This example demonstrates how to change the log level for the migrate context from INFO to DEBUG:

If using asadm it is as simple as typing the following command with the log file path. Keep in mind that by default asadm makes changes to every node in the cluster.

$ asadm -h -p 3000 -e "enable; manage config logging file /var/log/aerospike/aerospike.log param migrate to debug"

or if using asinfo:

$ asinfo -h -p 3000 -v "log-set:id=0;migrate=debug"

where the id is the log ID as described above (currently 0). This command changes the logging level until the server restarts or until you change the log level again.

This example demonstrates how to change the log level for the migrate context back to INFO:

$ asadm -h -p 3000 -e "enable; manage config logging file /var/log/aerospike/aerospike.log param migrate to info"