Use loggers in an application
This article describes how to use Java logging within an application.
Overview
To instrument an application using Java logging, perform the following steps:
Procedure
- Create the necessary handler, formatter, and filter classes, if we need your own log files.
- If localized messages will be used by the application, create a resource bundle as described in href="Creating_log_resource_bundles_and_message_files.html">Creating log resource bundles and message files.
- In the application code, get a reference to a logger instance as described in href="Use_a_logger.html">Using a logger.
- Insert the appropriate message and trace logging statements in the application as described in href="Use_a_logger.html">Using a logger.
See also
Using a logger
Understanding the logger hierarchy
Creating log resource bundles and message files
Creating a custom log handler
Creating a custom filter
Creating a custom formatter
Using custom handlers, filters, and formatters