Cover 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

O'Reilly logo

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 the format of log messages. You can write log messages to the console, a file, or a database.
  • A name: Usually, the name of a Logger used in a class that's based on the class name and its package name.
  • A level: Log messages have a level associated that indicates its importance. A Logger also has a level used to decide what messages it is going to write. It only writes the messages that are as important as, or more important, than its level.

You should use the log system with the following two main purposes:

  • Write as much ...

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