Administrative Issues

Use

Error Handling Mechanism

The error handling mechanism must be done carefully in the logging tool. It must not disturb the running application. Therefore, the errors occurring within the logging framework have to be thrown and caught appropriately.

Workaround

The approach is to tolerate the exception and to correct the error. The program then continues to run. The exception is not lost; it is stored temporarily and can be retrieved by the caller through the getException() and throwException() methods.

Examples

Some of the potential mistakes are: invalid severity definition, poor configuration, meaningless null message string, wrong resource bundle information, and so on. These can be rectified internally and a message can be logged to indicate the problem without terminating the program. There are several ways for replacing the incorrect value with the best-guess value:

  • Using the default value.

    More information: Appendix C: Default Behavior of Certain Objects .

  • Estimating the closest value.

  • Ignoring it.

Exceptions generated from methods, called in static field declarations and initializers, lead to an immediate program termination when the class is loaded.