In logging frameworks like log4j & log4net you have the ability to log various levels of information. Most of the levels have obvious intentions (such as what a "Debug" log is vs. a "Error"). However, one thing that I have always been timid on was classifying my logging as "Fatal".
What type of errors are so severe that they should be classified as fatal? While this is slightly case driven, what are some of the rules-of-thumb that you use when deciding between logging an exception as fatal or just simply error?
A Fatal Error Log. Describes the fatal error log, its location, and contents. The fatal error log is created when a fatal error occurs. It contains information and the state obtained at the time of the fatal error.
The FATAL level of logging shows that the application's situation is catastrophic, such that an important function is not working. For example, you can use FATAL log level if the application is unable to connect to the data store.
What Does Fatal Error Mean? A fatal error is an error that causes a program to terminate without any warning or saving its state. A fatal error, upon occurring, aborts the application currently running, and may cause the user to lose any unsaved changes made in the program.
The FATAL level designates very severe error events that will presumably lead the application to abort. static Level. INFO. The INFO level designates informational messages that highlight the progress of the application at coarse-grained level. static Level.
I consider fatal errors to be when your application can't do any more useful work. Non-fatal errors are when there's a problem but your application can still continue to function, even at a reduced level of functionality or performance.
Examples of fatal errors include:
Non-fatal errors would include:
An error is Fatal if something is missing or a situation occurs for which the application can simply not continue. Possible examples are a missing required config.file or when an exception 'bubbles up' and is caught by an unhandled exception handler
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With