|
| 1 | +## Logging Congiguration |
| 2 | +-- |
| 3 | + |
| 4 | +firecracker-containerd allows for users to specify per application/library |
| 5 | +logging. We do this by setting the `log_levels` field in the |
| 6 | +firecracker-runtime.json file. |
| 7 | + |
| 8 | +```json |
| 9 | +{ |
| 10 | + "firecracker_binary_path": "/usr/local/bin/firecracker", |
| 11 | + "kernel_image_path": "/var/lib/firecracker-containerd/runtime/default-vmlinux.bin", |
| 12 | + "kernel_args": "ro console=ttyS0 noapic reboot=k panic=1 pci=off nomodules systemd.journald.forward_to_console systemd.unit=firecracker.target init=/sbin/overlay-init", |
| 13 | + "root_drive": "/var/lib/firecracker-containerd/runtime/default-rootfs.img", |
| 14 | + "cpu_count": 1, |
| 15 | + "cpu_template": "T2", |
| 16 | + "log_levels": ["debug"], |
| 17 | + "jailer": { |
| 18 | + "runc_binary_path": "/usr/local/bin/runc" |
| 19 | + } |
| 20 | +} |
| 21 | +``` |
| 22 | + |
| 23 | +| log levels | description | |
| 24 | +| :---------------------------: | :-----------------------------------------------------------------------------: | |
| 25 | +| error | This will set all log levels to error | |
| 26 | +| warning | This will set all log levels to warning | |
| 27 | +| info | This will set all log levels to info | |
| 28 | +| debug | This will set all log levels to debug | |
| 29 | +| firecracker:error | Logs any error information in Firecracker's lifecycle | |
| 30 | +| firecracker:warning | Logs any error and warning information in Firecracker's lifecycle | |
| 31 | +| firecracker:info | Logs any error, warning, info information in Firecracker's lifecycle | |
| 32 | +| firecracker:debug | Most verbose log level for firecracker | |
| 33 | +| firecracker:output | Logs Firecracker's stdout and stderr. Can be used with other firecracker levels | |
| 34 | +| firecracker-go-sdk:error | Logs any errors information in firecracker-go-sdk | |
| 35 | +| firecracker-go-sdk:warning | Logs any errors or warnings in firracker-go-sdk | |
| 36 | +| firecracker-go-sdk:info | Logs any errors, warnings, or infos in firecracker-go-sdk | |
| 37 | +| firecracker-go-sdk:debug | Most verbose logging for firecracker-go-sdk | |
| 38 | +| firecracker-containerd:error | Logs any error information during the container/vm lifecycle | |
| 39 | +| firecracker-containerd:warning | Logs any error level logs along with any warn level logs | |
| 40 | +| firecracker-containerd:info | Logs any error, warn, and info level logs | |
| 41 | +| firecracker-containerd:debug | Most verbose logging for firecracker-containerd | |
| 42 | + |
| 43 | +The firecracker:XX are mutually exclusive with other firecracker-YY meaning only one of the log levels can be set at a time. |
| 44 | +However, firecracker:output may be set with other firecracker:YY settings. |
| 45 | +The firecracker-containerd:XX are also mutually exclusive with other firecracker-containerd-YY levels |
| 46 | +info, error, warning, and debug are mutually exclusive and only one can be set at a time. |
| 47 | + |
| 48 | +```json |
| 49 | +{ |
| 50 | + "firecracker_binary_path": "/usr/local/bin/firecracker", |
| 51 | + "kernel_image_path": "/var/lib/firecracker-containerd/runtime/default-vmlinux.bin", |
| 52 | + "kernel_args": "ro console=ttyS0 noapic reboot=k panic=1 pci=off nomodules systemd.journald.forward_to_console systemd.unit=firecracker.target init=/sbin/overlay-init", |
| 53 | + "root_drive": "/var/lib/firecracker-containerd/runtime/default-rootfs.img", |
| 54 | + "cpu_count": 1, |
| 55 | + "cpu_template": "T2", |
| 56 | + "log:levels": ["info","firecracker:debug","firecracker-containerd:error"], |
| 57 | + "jailer": { |
| 58 | + "runc_binary_path": "/usr/local/bin/runc" |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +The example above shows that setting the log levels to info, but specifies that |
| 64 | +firecracker to be on a debug level and firecracker-containerd to be logging at |
| 65 | +the error level |
0 commit comments