I'm interacting with a closed Spring Boot jar I ca...
# server
f
I'm interacting with a closed Spring Boot jar I can't edit (actually, I don't even have access to the jar, I'm just editing the Docker run arguments when it gets booted in the cloud somewhere) by default, Spring Boot doesn't pipe logs or sysout anywhere, it just displays it in console and that's it there is a logging.file=blabla config attribute you can tweak to make it do it but I don't have access to the prod.yml etc files = can I just -Dlogging.file=/dev/stdout when booting the app and that should "take"?
s
What do you mean by 'console', if not stdout?
If it's displaying in the console, that means it is going to stdout, and you can do whatever else you want with it from there
Unless I've misunderstood your message entirely
Afaik that is best practice for dockerised apps -- à la 12-factor
f
haha you're right, I guess what I'm asking is in case I also want to write it to the file
Copy code
dev/stdout
and I don't have access to the config files, nor the jar itself lol, will telling Docker to send in the run arg
Copy code
-Dlogging.file=/dev/stdout
when it boots the jar take care of that?
in my case, there should be another docker sidecar "listening" for logs there and piping them to splunk
a
You can also try
nohup
- i.e. something like:
Copy code
nohup <spring startup & args> > nohup.out
and your logs will be appended to
nohup.out
s
Not sure I understand the distinction between the 'file' and the console. Won't
/dev/stdout
just act as a link to the process' own output stream anyway? (The one it's already writing to)
f
oh dang I didn't realize what's showing up in console is actually the same thing as /dev/stdout if that's the case, what's weird is, our Splunk sidecar should be listening there, but we don't see anything show up in Splunk = either output and logs are not being piped there, or it is and the Splunk sidecar is in fact seeing it there but failing to stream that on to our Splunk somehow
actually on confirmation booting the image locally using docker run, I do get the normal spring output in the terminal (=console) but if I docker exec -it /bin/bash into the running container and less /dev/stdout, there's nothing there 🤔
s
Afaik
/dev/stdout
points to the output stream of the current process
So I assume
less /dev/stdout
would just show its own output, which is breaking my mind so I'm not going to think about that too hard
f
😆
c
if that's the case, what's weird is, our Splunk sidecar should be listening there, but we don't see anything show up in Splunk
You can't listen to
/dev/stdout
. The only thing in there is what the current process itself is writing.