There's more...

When you work with a log system, you have to take into consideration two important points:

  • Write the necessary information: If you write too little information, the logger won't be useful because it won't fulfil its purpose. If you write a lot of information, you will generate large unmanageable log files; this will make it difficult to get the necessary information.
  • Use the adequate level for the messages: If you write high level information messages or low level error messages, you will confuse the user who will look at the log files. This will make it more difficult to know what happened in an error situation; alternatively, you will have too much of information making it difficult to know the main cause of the error.

There are other libraries that provide a log system that is more complete than the java.util.logging package, such as the Log4j or slf4j libraries. But the java.util.logging package is part of the Java API, and all its methods are multithread safe; therefore, we can use it in concurrent applications without problems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.180.70