Forums Register Login

java logging

+Pie Number of slices to send: Send
If we have both log4j logging (like logger.debug, logger.error, logger.info..) and System.out.prinltn in a production server. The System.out.println will just not produce anything when the class is run at background. But does System.out.println can halt the program's execution for any reason or under any condition just because the program does not know how to print it out ? Or will it just skip it if it can't print it out ?
+Pie Number of slices to send: Send
No, you don't have to worry about println(). You can redirect the program output (to a file, for example), and if you don't, nothing will happen if the program is run in background, or if it uses a GUI instead of a console.
+Pie Number of slices to send: Send
Thanks. So, no matter if my code is run as a background job, or called by another script, etc. whenever the system finds there is no console for it to output (assuming I don't redirect to file or other device), it will just NOT be able to output it, right ?
It will just act like quietly ignoring this println() and move on, right ?

The bottom line --- It won't halt the program or throw any exception in this case, am I correct ?
+Pie Number of slices to send: Send
Yes.
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 504 times.
Similar Threads
log entries with java logging
jdk logger manager reinitialization does not work fine in Websphere
jdk logger manager reinitialization does not work fine in Websphere
setTime() function not setting the time
Soap Handler question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:11:54.