Do not use System.out.println in server side code

System.out.println is an IO-operation and therefor is time consuming.
The Problem with using it in your code is, that your program will wait until the println has finished. This may not be a problem with small sites but as soon as you get load or many iterations, you’ll feel the pain.

The better approach is to use a logging framework.
They use a message queue and write only if no other output is going on.

And another benefit is that you can configure separate log files for different purposes.
Something your Ops team will love you for.

Read more here:

Leave a Comment