---
title: "Manual log rotation"
description: "Guide on manually rotating Aerospike database log files via the SIGHUP signal and identifying log locations."
---

# Manual log rotation

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Log rotation is managed by `systemd-journald`, and in normal operations you don’t have to pay attention to it. However, there are some use cases for manual file rotation, such as:

-   Free up storage space.
-   Separate debugging logs.
-   Move log files to a different location.

Follow these steps to manually rotate the log file. The following steps use `/var/log/aerospike/aerospike.log` for the example log file.

1.  Move the existing log file to a new location, which is anywhere you want:
    
    Terminal window
    
    ```bash
    mv /var/log/aerospike/aerospike.log /var/log/aerospike/aerospike-old.log
    ```
    
2.  Find the `asd` (Aerospike daemon) process ID. In systemd environments use the `pidof` command:
    
    ```plaintext
    pidof asd
    ```
    
    The expected output is a process number, for example:
    
    ```text
    3513
    ```
    
    In non-systemd environments read its pidfile:
    
    ```plaintext
    cat /var/run/aerospike/asd.pid
    ```
    
3.  Send a SIGHUP to the `asd` process:
    
    ```text
    kill -s SIGHUP 3513
    ```
    
    The following message is printed at the end of the old log file:
    
    ```text
    SIGHUP received, rolling log
    ```
    

Aerospike re-creates the original log file, and only new messages appear in it.

## Finding the log ID and log file location

Use `asinfo` to find the log IDs and log file locations:

Terminal window

```bash
asinfo -v "logs" -l
```

Expected output:

```text
0:/var/log/aerospike/aerospike.log

1:stderr
```

The example output shows that there is a log file at `/var/log/aerospike/aerospike.log`, and a second logging stream directed to stderr. See [Configuring Log Files](https://aerospike.com/docs/database/8.0.0/manage/logging/logs) for more information.