Using logging within an EJB
Logging is a useful technique for recording exceptions and significant events which occur during the execution of an application. While there are many different logging APIs available, we will focus on those classes found in the
java.util.logging package. If you are interested you may find alternate logging technologies such as log4j (http://logging.apache.org/log4j/1.2/) or the Simple Logging Facade for Java (SLF4J) (http://www.slf4j.org/) to be useful.
The process of creating using a logger involves:
- Importing the
- Using the
Loggerclass' static method
getLoggerto obtain an instance of a logger
- Using methods of the
Loggerto record application data
- Optionally, various filters, handlers, ...