Application Logs and the Logger Class

In his "Class of the Month" column, Mohseni examines the benefits of the core logging facilities contained in the java.util.logging package, which can be very helpful in maintenance and troubleshooting, as well as cross-platform compatibility.

provided by: 
Originally published at Internet.com


Application logs serve different purposes. They can help in debugging, remote troubleshooting, and tracking. The logging requirements usually depend on who is going to use the logs. A developer would need a more detailed log compared to an end-user trying to fix a common problem.

Piroz Mohseni

Another common requirement is the ability to transmit the log (via a protocol such as HTTP) to a remote location. This not only allows supporting customers remotely but also serves as a useful data-gathering mechanism where development teams can create profiles of their application usage and the conditions under which it is failing.

Addressing these requirements, with JDK 1.4, the Java platform will support a set of core logging facilities contained in the java.util.logging package. The main class is Logger. You obtain an instance of Logger using the static getLogger() method with a unique name as its argument: static Logger logger = Logger.getLogger("com.foo.someClass");

Each Logger has a "Level" associated with it that can be set using the setLevel() method. This reflects a minimum Level that the logger cares about. If a Logger's level is set to null, then its effective level is inherited from its parent. The different levels can be found as fields in the Levels class: * SEVERE (highest value) * WARNING * INFO * CONFIG * FINE * FINER * FINEST (lowest value) ...

Read article at Internet.com site
Regional Articles
- Application Logs and the Logger Class Alabama
- Application Logs and the Logger Class Alaska
- Application Logs and the Logger Class Arizona
- Application Logs and the Logger Class Arkansas
- Application Logs and the Logger Class California
- Application Logs and the Logger Class Colorado
- Application Logs and the Logger Class Connecticut
- Application Logs and the Logger Class DC
- Application Logs and the Logger Class Delaware
- Application Logs and the Logger Class Florida
- Application Logs and the Logger Class Georgia
- Application Logs and the Logger Class Hawaii
- Application Logs and the Logger Class Idaho
- Application Logs and the Logger Class Illinois
- Application Logs and the Logger Class Indiana
- Application Logs and the Logger Class Iowa
- Application Logs and the Logger Class Kansas
- Application Logs and the Logger Class Kentucky
- Application Logs and the Logger Class Louisiana
- Application Logs and the Logger Class Maine
- Application Logs and the Logger Class Maryland
- Application Logs and the Logger Class Massachusetts
- Application Logs and the Logger Class Michigan
- Application Logs and the Logger Class Minnesota
- Application Logs and the Logger Class Mississippi
- Application Logs and the Logger Class Missouri
- Application Logs and the Logger Class Montana
- Application Logs and the Logger Class Nebraska
- Application Logs and the Logger Class Nevada
- Application Logs and the Logger Class New Hampshire
- Application Logs and the Logger Class New Jersey
- Application Logs and the Logger Class New Mexico
- Application Logs and the Logger Class New York
- Application Logs and the Logger Class North Carolina
- Application Logs and the Logger Class North Dakota
- Application Logs and the Logger Class Ohio
- Application Logs and the Logger Class Oklahoma
- Application Logs and the Logger Class Oregon
- Application Logs and the Logger Class Pennsylvania
- Application Logs and the Logger Class Rhode Island
- Application Logs and the Logger Class South Carolina
- Application Logs and the Logger Class South Dakota
- Application Logs and the Logger Class Tennessee
- Application Logs and the Logger Class Texas
- Application Logs and the Logger Class Utah
- Application Logs and the Logger Class Vermont
- Application Logs and the Logger Class Virginia
- Application Logs and the Logger Class Washington
- Application Logs and the Logger Class West Virginia
- Application Logs and the Logger Class Wisconsin
- Application Logs and the Logger Class Wyoming
Related Articles
- JBoss Application Server
Learn how to secure a web service using WS-Security. WS-Security is a specification from OASIS (Organization for the Advancement of Structured Information Standards) that describes enhancements to SOAP messaging to provide message integrity and confidentiality.
- Class of the Month: The Reflection API
- Views from Abroad: Close Up On Jetty
- Use the BodyTagSupport Class to Add More Flexibility to JSP Pages
- Some Insight Into Inner Classes in Java, Part 2
- Adding Animated Movement to Java Applications
- User Code: Method Finder
- Manage Your Application Settings via the Preferences API
- Class of the Month: Making HTTP Connections
- User Code: A Little Socket App

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML