file

Reference for the `file` adapter.

file · adapter · run nanook doc file for the same content in your terminal.

Logs metrics to a file with optional rotation.

Options

OptionTypeDefaultDescription
pathstringnanook.loglog file path
sizestring10max file size in MB before rotation (0 disables)
filesstring5max number of rotated files to keep (0 is unlimited)
rotateenumsizerotation mode (one of: size, hourly, daily)

Examples

Size-based rotation, keep last 5

[[adapters]]
kind = "file"
[adapters.opts]
path = "/var/log/nanook/metrics.log"
size = 50      # rotate at 50 MB
files = 5
rotate = "size"

Daily rotation for long retention

[[adapters]]
kind = "file"
[adapters.opts]
path = "/var/log/nanook/daily.log"
rotate = "daily"
files = 30