In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
docker log collection, first need to understand docker log driver type
The json-file log format is json. Default log driver
2. none does not produce logs
3. syslog writes logs to syslog, which must be running on the host
4. localLog storage in custom format for minimal overhead
5. journald Write the journal to journald
These are the most common log drivers, right? Modify docker driver type
1. Directly modify docker daemon.json file
vim /etc/docker/daemon.json
{
"log-driver": "log driver type"
"log-opts":{
"max-size": "10m",
"max-file": "3",
"labels": "xxxxxxx" }
}
2. The second type is to set the log driver type and label information of the container when the container is started.
This experiment is to collect the second way to configure the log driver type: syslog, and use filebeat collection
command operation
docker run --rm -itd --hostname test --log-driver syslog --log-opt sy-address =udp://log sent to ip:port --log-opt tag=test(label log) nignx
filebeat's profile:
vim syslog.json
filebeat.inputs:
- type: udp
host: "192.168.191.10:5144"
tags: ["syslog"]
output.file:
path: "/root/syslog"
filename: syslog.log
# rotate_every_kb: 1000
# number_of_files: 3
Start filebeat
nohup ./ filebeat -e -c syslog.json &
View log output file information
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.