Skip to main content

Logging

Planka currently allows you to expose the application's logfile directory to the host machine via a shared volume. This feature is NOT enabled by default.

To expose the logfile director to the host machine, add the item ./logs/:/app/logs/ under services.planka.volumes.

Note that the directory to the left of the semicolon is regarding the host machine while the directory to the right of the semicolon is regarding the Docker container.

For example, in the above step, ./logs/:/app/logs/ will create the folder logs in the same directory where the docker-compose.yml file lives.

If your logs are not being written to the logfile directory, you may need to adjust the permissions. See the information at the end of the Docker Compose guide for more information.

Rotating Logs

Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

Setup logrotate for Planka logs

Create a file in /etc/logrotate.d named planka with the following contents:

/path/to/planka/logs/planka.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
}

Ensure to replace logfile directory with your installation’s /logs/planka.log location.

Restart the logrotate service.