What should ideally contain an application log?

What information should the application log contain? How does this differ from the error log?

+4
source share
5 answers

You will get many different opinions on this subject .....

Ultimately, it should contain any information that you think will be relevant to your application. It should also contain information that helps you determine what is happening with the application. This does not mean that it should contain errors, but it can if you want to use it in this way.

At a minimum, I would suggest that you include:

  • application start / stop time
  • app name
  • skip / failure information (if applicable)

Optional elements:

  • call processing (if not too intense)
  • if you decide to combine application and error logs
  • messaging (if not too intense)

One thing you want to keep in mind is that you don’t want to write so much information in your logs that you affect the performance of your application. In addition, you want your log files not to be so large that you run out of disk space.

+3
source

The true error log should contain:

  • Trace the stack where the error occurred.
  • Local variables present at the error point.
  • The timestamp when the error occurred.
  • Details of the exception (if this is an exception).

General application log file for event tracking, etc. should contain less internal information and possibly be more user friendly.

Honestly, the answer really depends on what software the magazine is for.

+2
source

Ideally, it should contain exactly the information needed to diagnose an application problem, or an analysis of a specific aspect of its past behavior. The only thing that makes it hard to do is that you don’t know in advance what problems will arise or what aspects of the application’s behavior will interest you in the future. You cannot register every application state change, but you only need to register. How much is enough? This is hard to say and very application dependent. I doubt the desktop calculator logs everything.

Any errors will be recorded in the error log. Unexpected exceptions and other unexpected conditions.

+2
source

An application log usually contains errors, warnings, events, and non-critical information, in contrast to an error log that usually contains only errors and critical warnings.

+1
source

The application log should contain all the information necessary for the audit. This may include things like successful / unsuccessful login and any specific actions. The error log can be a subset of the application log or a separate log containing only information related to errors in the application.

+1
source

All Articles