Hi @Paul Clapham Thanks for your reply!
You said this was a "JSP web" project. So regardless of that logging issue, where do you expect System.out to point to?
I am expecting System.out to point to Dockers container log "catch" mechanism. Which in the Tomcat image should be implemented per default through catalina.sh
the catalina 'run' command is designed to redirect all logs to stdout
Hi @Tim Holloway! Thanks for your reply!
I understand that logging to a file is considered best practice, instead of logging to stdout (Linux).
Though for my understanding of how logging to stdout works i would very much like to get my current project to work, where i can use log4j to log messages of different level to stdout.
So i have been digging in it a bit to try and understand what is going wrong.
To run my JVM i am using Docker, which as i understand has a series of logging drivers that Tomcat's image from Docker hub uses to use a "de-facto" way to log to the Docker container the image runs in,
from there Docker saves the log to a file that you can determine the size of and rotate when necessary.
In my Java-EE project i have not directly used a logging framework or implemented one before, i have just always used System.out and never really given it much thought.
Currently i'am using Quartz library (API) that under the hood uses slf4j.
The problems i have are currently
1. Quartz starts a scheduler that has a series of tasks that executes different methods. If i in these methods use System.out, messages are written to the console no issues.
But if i use System.out in a method not managed by Quartz, nothing is written to the console.
2. I have tried to implement log4j and slf4j by themselves, and also followed this guide https://www.codejava.net/coding/how-to-initialize-log4j-for-java-web-application
to make sure that the log4j configuration was loaded properly.
But trying to log anything to the console is a no-go, and we are back to problem #1.
I think it's super weird, Docker has a standardlized way of getting receiving console logging, and Tomcat's upstart logs along with System.out inside Quartz methods are logged fine.
But everything else is not.
Hope someone has an idea as to what i could look into or try to learn what is going wrong.