+

Search Tips   |   Advanced Search

Use loggers in an application


This page describes how to use Java logging within an application.

To create an application using Java logging...

 

  1. Create the necessary handler, formatter, and filter classes if we need our own log files.

  2. If localized messages are used by the application, create a resource bundle

  3. In the application code, get a reference to a logger instance.

  4. Insert the appropriate message and trace logging statements in the application.


Use a logger
Set the logger hierarchy
Create log resource bundles and message files
Change the message IDs used in log files
Example: Creating custom log handlers with java.util.logging
Example: Creating custom filters with java.util.logging
Example: Creating custom formatters with java.util.logging
Example: Adding custom handlers, filters, and formatters