Save docker logs to /srv/cci/serial/logs/$hostname. So fluentd can tail this file and send logs to monitoring service. In this way can generate docker's dmsg file
Signed-off-by: Wu Zhende wuzhende666@163.com --- providers/docker/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/providers/docker/run.sh b/providers/docker/run.sh index 4d53db7..2810641 100755 --- a/providers/docker/run.sh +++ b/providers/docker/run.sh @@ -7,6 +7,7 @@ : ${docker_image:="centos:7"} : ${load_path:="${HOME}/jobs"} : ${hostname:="dc-1g-1"} +: ${log_dir:="/srv/cci/serial/logs/$hostname"}
if [[ $hostname =~ ^(.*)-[0-9]+$ ]]; then tbox_group=${BASH_REMATCH[1]} @@ -38,4 +39,4 @@ cmd=( /root/sbin/entrypoint.sh )
-"${cmd[@]}" +"${cmd[@]}" 2>&1 | tee -a "$log_dir"
On Sat, Jan 16, 2021 at 11:37:11AM +0800, Wu Zhende wrote:
Save docker logs to /srv/cci/serial/logs/$hostname. So fluentd can tail this file and send logs to monitoring service. In this way can generate docker's dmsg file
Signed-off-by: Wu Zhende wuzhende666@163.com
providers/docker/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/providers/docker/run.sh b/providers/docker/run.sh index 4d53db7..2810641 100755 --- a/providers/docker/run.sh +++ b/providers/docker/run.sh @@ -7,6 +7,7 @@ : ${docker_image:="centos:7"} : ${load_path:="${HOME}/jobs"} : ${hostname:="dc-1g-1"} +: ${log_dir:="/srv/cci/serial/logs/$hostname"}
we can use fluentd collect docker log, i have redirect stdout to /dev/stdout for docker, so fluentd can collect it format: {{job_id}}:xxxxx
then monitor tools can show it
Thanks, Shenwei
if [[ $hostname =~ ^(.*)-[0-9]+$ ]]; then tbox_group=${BASH_REMATCH[1]} @@ -38,4 +39,4 @@ cmd=( /root/sbin/entrypoint.sh )
-"${cmd[@]}"
+"${cmd[@]}" 2>&1 | tee -a "$log_dir"
2.23.0