How do I obtain or create a Logger?
Category: java.util.logging, viewed: 1418 time(s).
Since JDK 1.4 a logging API was introduced into the Java class libraries. This API enable our application to logs some messages to record our application activities.
To create an instance of Logger we can call the Logger.getLogger()
factory method which will return the available logger for the given namespace or
it will create a new one when it doesn't exist.
After we create the Logger instance we can create a message log
by calling the logging method such as info(String message),
warning(String message) and severe(String message).
Below are some message produces by the Logger.
27 Apr 09 13:01:07 org.kodejava.example.util.logging.LoggingDemo main INFO: Info Message 27 Apr 09 13:01:07 org.kodejava.example.util.logging.LoggingDemo main WARNING: Warning Message 27 Apr 09 13:01:07 org.kodejava.example.util.logging.LoggingDemo main SEVERE: Severe Message
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!


