Skip to content

Logging

Derek Williamson edited this page Sep 11, 2019 · 1 revision

The logger is public static, so you can access it from anywhere within DnDTracker.Web.

There are 4 methods:

  1. Log.Info(string message) For logging any information you may need while the app is running.
  2. Log.Error(string message, Exception ex = null) For logging errors when something breaks the window.
  3. Log.Warn(string message, Exception ex = null) For logging errors when something falls out the window, but it wasn't expensive.
  4. Log.Debug(string message, Exception ex = null) For logging developer-centric verbose information to the VS Debug Output stream (only works locally).

Info, Error, and Warn will log to DynamoDb both locally and in higher environments. Any types listed in disallowedTypeNameWords or methods in disallowedMemberNameWords of Log.WithTag() will not log to DynamoDb (due to infinite recursion or other issues).

The Exception ex parameter is optional and is only used to extract the stack trace. Only use this if it's applicable. This will not save the Exception.Message, so embed it in your string message if needed.

Clone this wiki locally