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 ?
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.
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 ?