Focusing on Logging

In Chapter 5, I presented a simple logging framework to demonstrate packages. Logging is the recording of data while an application runs and is an important part of application development and maintenance. Messages are logged (captured as formatted records) to files or other destinations to help diagnose any problems that arise as an application executes.

Creating your own logging framework is typically a waste of time and you should use the standard java.util.logging package instead. This package implements Java’s Logging API, which was introduced in Java 1.4. Oracle’s documentation for java.util.logging states that there are four main uses for the logs (repositories of log entries) generated by the Logging API:

  • Problem ...

Get Learn Java for Android Development, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.