Application Logging needs work

Posted on DotNetBlocks See other posts from DotNetBlocks
Published on Sat, 17 Mar 2012 19:08:00 -0700 Indexed on 2014/06/08 21:37 UTC
Read the original article Hit count: 205

Filed under:

Application Logging

Application logging is the act of logging events that occur within an application much like how a court report documents what happens in court case. Application logs can be useful for several reasons, but the most common use for logs is to recreate steps to find the root cause of applications errors. Other uses can include the detection of Fraud, verification of user activity, or provide audits on user/data interactions.

“Logs can contain different kinds of data. The selection of the data used is normally affected by the motivation leading to the logging. “ (OWASP, 2009)

OWASP also stats that logging include applicable debugging information like the event date time, responsible process, and a description of the event.

“There are many reasons why a logging system is a necessary part of delivering a distributed application. One of the most important is the ability to track exactly how many users are using the application during different time periods.” (Hatton, 2000)

Hatton also states that application logging helps system designers determine whether parts of an application aren't being used as designed. He implies that low usage can be used to identify if users like or do not like aspects of a system based on user usage of the application. This enables application designers to extract why users don't like aspects of an application so that changes can be made to increase its usefulness and effectiveness.

“Logging memory usage can also assist you in tuning up the internals of your application.
If you're experiencing a randomly occurring problem, being able to match activities performed with the memory status at the time may enable you to discover the cause of the problem. It also gives you a good indication of the health of the distributed server machine at the time any activity is performed. “ (Hatton, 2000)

Commonly Logged Application Events (Defined by OWASP)

  • Access of Data
  • Creation of Data
  • Modification of Data in any form
  • Administrative Functions 
  • Configuration Changes
  • Debugging Information(Application Events) 
  • Authorization Attempts 
  • Data Deletion
  • Network Communication 
  • Authentication Events 
  • Errors/Exceptions

Application Error Logging

The functionality associated with application error logging is actually the combination of proper error handling and applications logging.  If we look back at Figure 4 and Figure 5, these code examples allow developers to handle various types of errors that occur within the life cycle of an application’s execution. Application logging can be applied within the Catch section of the TryCatch statement allowing for the errors to be logged when they occur. By placing the logging within the Catch section specific error details can be accessed that help identify the source of the error, the path to the error, what caused the error and definition of the error that occurred. This can then be logged and reviewed at a later date in order recreate the error that was received based data found in the application log. By allowing applications to log errors developers IT staff can use them to recreate errors that are encountered by end-users or other dependent systems.

© DotNetBlocks or respective owner