file
Reference for the `file` adapter.
file· adapter · runnanook doc filefor the same content in your terminal.
Logs metrics to a file with optional rotation.
Options
| Option | Type | Default | Description |
|---|---|---|---|
path | string | nanook.log | log file path |
size | string | 10 | max file size in MB before rotation (0 disables) |
files | string | 5 | max number of rotated files to keep (0 is unlimited) |
rotate | enum | size | rotation mode (one of: size, hourly, daily) |
Examples
Size-based rotation, keep last 5
[[]]
= "file"
[]
= "/var/log/nanook/metrics.log"
= 50 # rotate at 50 MB
= 5
= "size"
Daily rotation for long retention
[[]]
= "file"
[]
= "/var/log/nanook/daily.log"
= "daily"
= 30