PPM provides built-in log file rotation to help manage disk usage and retain recent logs.
By default, this feature is disabled. When disabled, services inherit stdout and stderr from the PPM daemon, meaning logs are displayed directly in your container console.
To enable log file management, add the following section to your configuration file:
Once enabled, PPM will write logs to files instead of forwarding them to the console.
You can fine-tune the logger behavior using the following options (shown here with their default values):
path
Directory where log files will be written.
If the directory does not exist, it will be created automatically.
PPM must have write permissions for this directory.
max_files
The maximum number of log files kept per service.
When the limit is reached, the oldest log file is removed.
max_file_size
The size threshold that triggers log rotation.
When the active log file reaches this size, a new log file is created.
Note: A log file may slightly exceed max_file_size to ensure the last buffered log line is fully written and not truncated.
Log files are named using the following format: <service_name>-<date>.log
Each service maintains its own set of rotated log files.
The PPM client provides convenient commands for accessing service logs:
Here's an example on how to use the logger, using a service that writes current date every second:
