0

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"}
Rajesh
  • 61
  • 1
  • 2
  • 5
  • It's something in your application or logging setup, not Docker proper. You could see this outside of Docker by running `your application >/dev/null`, which will suppress stdout and just show you the things going to stderr. – David Maze Feb 21 '20 at 10:26
  • Thanks David, Individually when I run application it is showing INFO , WARNING levels properly, however in the docker json-file log it is showing with stream:stderr. So any idea why docker container considering this as an error ? Because <Container -d>-json.log generated by docker itself – Rajesh Feb 21 '20 at 10:33
  • When you start a process there are two different places output can go to, standard output and standard error streams. It's sort of like the process starting with two open files and being able to write messages to either. Docker isn't saying "this is an error" but rather "the application wrote this to stderr". Another way to demonstrate this split is running `your application >stdout.log 2>stderr.log`. – David Maze Feb 21 '20 at 10:35
  • Oh! Ok, means I need to search where stdout [ 1 ] stream also redirecting stderr [ 2 ]. Understand. Thank you for information. – Rajesh Feb 21 '20 at 11:22
  • Adding to the above, I have used System.err.println() & System.out.println() on my Spring Boot sample application. Both are showing as stream:"stdout" only. So my question, some where docker will take configuration of these. Can anybody please tell me if you have idea ? – Rajesh Feb 25 '20 at 06:10
  • {"log":" Hellow Docker World !! : OUT Stream \r\n","stream":"stdout","time":"2020-02-25T06:08:12.549702764Z"} {"log":" Hellow Docker World !! : ERROR Stream \r\n","stream":"stdout","time":"2020-02-25T06:08:12.549741997Z"} – Rajesh Feb 25 '20 at 06:10
  • I have run following command : docker run -p 8080:8080 -t springio/gs-spring-boot-docker and spring boot article link : https://spring.io/guides/gs/spring-boot-docker/ – Rajesh Feb 25 '20 at 06:17

1 Answers1

-1

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

frk
  • 1
  • 2
  • This doesn't answer the question of what is causing these log messages and how to change the stream from stderr to stdout. – BMitch May 16 '21 at 14:21