-
Notifications
You must be signed in to change notification settings - Fork 6
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:
-
Log.Info(string message)
For logging any information you may need while the app is running. -
Log.Error(string message, Exception ex = null)
For logging errors when something breaks the window. -
Log.Warn(string message, Exception ex = null)
For logging errors when something falls out the window, but it wasn't expensive. -
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.