Skip to content

Instantly share code, notes, and snippets.

@h4cc
Created March 5, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4cc/9368872 to your computer and use it in GitHub Desktop.
Save h4cc/9368872 to your computer and use it in GitHub Desktop.
Explanation and grouping of loglevels.

Log Levels - RFC 5424.


Internals

This levels only needs to be findable for debugging purposes.

  • DEBUG (100): Detailed debug information.

  • INFO (200): Interesting events. Examples: User logs in, SQL logs.

    • NOTICE (250): Normal but significant events.

Expected Situations

This level should be used for expected situations. A immediate action is not necessary. Logging is done so the operator knows what happened and provide support. This logs can provide a "health" status of a application.

  • WARNING (300): Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

  • ERROR (400): Runtime errors that do not require immediate action but should typically be logged and monitored.


Fatal

Everything at this level, will need immediately action. A alert system like EMail or SMS should be considered.

  • CRITICAL (500): Critical conditions. Example: Application component unavailable, unexpected exception.

    • ALERT (550): Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
  • EMERGENCY (600): Emergency: system is unusable.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment