O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing effective log messages

A log system is a mechanism that allows you to write information to one or more destinations. A Logger has the following components:

  • One or more handlers: A handler will determine the destination and format of the log messages. You can write log messages in the console, a file, or a database.
  • A name: Usually, the name of a Logger used in a class is based on the class name and its package name.
  • A level: Log messages have different levels that indicate their importance. A Logger also has a level to decide what messages it is going to write. It only writes messages that are as important as, or more important, than its level.

You should use the log system because of the following two main reasons:

  • Write as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required