Files
linuxkit/examples/logging.yml
David Scott 565f787bb3 Add pkg/logwrite which writes and rotates log files
This process connects to memlogd and streams logs to individual files,
one per log. It keeps track of how many bytes have been written to each
file and rotates when the file size exceeds a defined threshold.

By default the maximum size of each file before rotation is 1MiB and
we keep up to 10 files per log.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:51 +01:00

33 lines
1.2 KiB
YAML

# Simple example of using an external logging service
kernel:
image: linuxkit/kernel:4.14.53
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:720920b4a1b4dd90c99e8f91d543381798c4c3cb
- linuxkit/runc:01b4f0706d999f9065ef44492689e43d0bcd83c5
- linuxkit/containerd:92c92a485b881b7b589ccc4a6279224931c8cadf
- linuxkit/ca-certificates:ce2692e89d2be341b0d3caa0b0aa01b37d5d0694
- linuxkit/memlogd:19e58ab6ae2c6be1751260aa60e91c441eda1294
onboot:
- name: sysctl
image: linuxkit/sysctl:6f96e509c7383b31dfdd2c3e9fa01c6ab3e4c586
- name: dhcpcd
image: linuxkit/dhcpcd:0aa201ad1a4c134f0ed6ab2cec23602d5ee73d7f
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
services:
# Inside the getty type `/proc/1/root/usr/bin/logread -F` to follow the log
- name: getty
image: linuxkit/getty:3763a7fc3fddedc185bbd6f7f583f729e57fbeda
env:
- INSECURE=true
# A service which generates log messages for testing
- name: write-to-the-logs
image: alpine
command: ["/bin/sh", "-c", "while /bin/true; do echo hello $(date); sleep 1; done" ]
- name: write-and-rotate-logs
image: linuxkit/logwrite:7859c102a963828fd9c5aa3837db9600483220c7
trust:
org:
- linuxkit
- library