简体   繁体   中英

log file handling with docker syslog logging driver

Is there a way to pick up the log messages which are logged to a log file, when using the syslog log driver of Docker?

Whatever I write to sysout are getting picked by Rsyslog but anything logged to a log file is not picked. I don't see any option in the syslog driver option which could help indicate a log file to be picked up.

Thanks

Dockers logging interface is defined as stdout and stderr, so the best way is to modify the log settings of your process to send any log data to stdout and stderr .

Some applications can configure logging to go directly to syslog. Java processes using log4j are a good example of this.

If logging to file is the only option available, scripts , logstash , fluentd , rsyslog , and syslog-ng can all ingest text files and output syslog. This can either be done inside the a container with an additional service, or using a shared, standardised logging area on each Docker host and running the ingestion from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM