Syntax
Commands
These commands measure and delete log files. They do not print log content. To
read the logs of the box services, see the Reading Service Logs section below.
Command Reference
size
Check the size of ~/box/logs on one Lager Box, or on every saved Lager Box.
--box BOX- Specific Lager Box (if not specified, checks all)--verbose/-v- Show individual log files
clean
Delete the *.log files in ~/box/logs that are older than a number of days.
--box BOX(required) - Lager Box to clean--older-than DAYS- Remove logs older than N days (default: 1)--yes- Skip confirmation prompt
docker
Check the size of the Docker log file of each running container. A Lager Box
runs one container, lager.
--box BOX(required) - Lager Box to check--container NAME- Specific container (default: all)
sudo -n over a non-interactive SSH session.
If sudo asks for a password on the box, the size line says unknown. The
command then tells you to allow sudo -n ls for the login user of the box.
Log Rotation
Docker containers use automatic log rotation:- Maximum size: 10 MB per file
- Maximum files: 3 (rotates oldest)
Size Thresholds
Thesize command uses warning thresholds:
What Gets Cleaned
Theclean command removes:
- Files that match
*.login~/box/logson the box host, and that are older than--older-thandays
- System logs in
/var/log/ - Docker container logs (managed separately)
- The service logs inside the container
- Files newer than
--older-thanthreshold
Reading Service Logs
The box services write their logs inside thelager container:
To read the last lines of a log, run
docker exec on the box:
Automation
Schedule regular log cleaning:Examples
Notes
--boxtakes the name of a saved Lager Box. An IP address is not accepted.- These commands connect over SSH as the user that you stored with
lager boxes add --user, or aslagerdataif you stored none. They use key authentication only: thelager_boxkey first, then your own SSH keys. - Docker logs are automatically rotated
- Use
--verboseto identify large log files - Regular cleaning prevents disk space issues

