-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace System.out.println with LOGGER #451
Conversation
The System.out.println ends up on stdout of the controller jvm but almost all other logout will end on stderr. Also the formatting of the timestamp is hard coded and usually differs from the normal logging output format. By using the LOGGER we get well formatted log messages and all is in stderr.
I have rejected this changes several times. The stdout of a remote agent it is not the same output that uses a logger. You changes only work if your agent is runnin in the Jenkins Controler, if the agent is in other machine you will lost those messages. |
Actually the changes are in the launch method which is code that runs on the controller not the agent. 2 of the 3 System.out are about failure to launch the agent so how should this ever be code that runs on the agent jvm? Looking at the plugin code I don't see any code at all that runs on the agent. |
I will repeat my self again #273 (comment) |
How is the behaviour of remoting here of any interest? You use |
I tested my changes and my agent is not running in the Jenkins controller and the output is still there in the controller logs as before. |
sorry for the delay, I found time to test your changes and see if everything is fine, I have tested it with the latest LTS version. For some reason, I thought those messages were sent to the remote channel(stdout in the agent process) but it is not so the change to use a logger is a nice improvement. https://github.com/kuisathaverat/jenkins-issues/tree/main/pr-451 |
The System.out.println ends up on stdout of the controller jvm but almost all other logout will end on stderr.
Also the formatting of the timestamp is hard coded and usually differs from the normal logging output format.
By using the LOGGER we get well formatted log messages with a proper log level which makes it easier for log analyzers.
jenkins.log
Before:
After:
The completed message is missing now from the log by default (due to Level.FINE)
Submitter checklist