显示以stderr作为流的INFO和WARNING语句的docker容器json日志 [英] docker container json log showing INFO and WARNING statements with stderr as stream

查看:85
本文介绍了显示以stderr作为流的INFO和WARNING语句的docker容器json日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在<容器ID> -json.log上找到一些带有INFO和WARNING且流作为stderr的警告.实际上,这些必须与流一起作为标准输出.有人能提供一个线索让我确切地研究一下吗?这是与docker相关的配置还是与我的应用程序相关的配置?例子,

On <Container Id>-json.log finding some entries with INFO and WARNING with stream as stderr. Actually, these have to be with stream as stdout. Can anybody give a clue to where exactly I need to look into this? Is this docker related configuration or my application related configuration? Example,

{"log":"[2020/02/20-08:50:26,557]-[**INFO**   ]-[362]-[testlogger]--4: 202a68dfd8621ee9de1a7ff4\n","stream":"stderr","time":"2020-02-20T08:50:26.55867314Z"}

推荐答案

cat $(docker ps -aq | xargs -I'{}'docker inspect --format ='{{.LogPath}}''{}'| xargs ls)| grep警告2>& 1

cat $(docker ps -aq | xargs -I'{}' docker inspect --format='{{.LogPath}}' '{}' | xargs ls) |grep WARNING 2>&1

这篇关于显示以stderr作为流的INFO和WARNING语句的docker容器json日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆