Click or drag to resize

Log Class

Provides methods for writing log.
Inheritance Hierarchy
SystemObject
  Casewhere.Infrastructure.LoggingLog

Namespace: Casewhere.Infrastructure.Logging
Assembly: Casewhere.Infrastructure.Logging (in Casewhere.Infrastructure.Logging.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static class Log

The Log type exposes the following members.

Properties
 NameDescription
Public propertyStatic memberContext 
Public propertyStatic memberCorrelationId 
Public propertyStatic memberRequestId 
Top
Methods
 NameDescription
Public methodStatic memberBeginContext 
Public methodStatic memberDebug(String) Write a log event with the Debug level.
Public methodStatic memberDebug(String, Object) Write a log event with the Debug level.
Public methodStatic memberDebug(Exception, String, Object) Write a log event with the Debug level and associated exception.
Public methodStatic memberError(String) Write a log event with the Error level.
Public methodStatic memberError(String, Object) Write a log event with the Error level.
Public methodStatic memberError(Exception, String, Object) Write a log event with the Error level and associated exception.
Public methodStatic memberFatal(String) Write a log event with the Fatal level.
Public methodStatic memberFatal(String, Object) Write a log event with the Fatal level.
Public methodStatic memberFatal(Exception, String, Object) Write a log event with the Fatal level and associated exception.
Public methodStatic memberFor(Type) 
Public methodStatic memberForT 
Public methodStatic memberInfo(String) Write a log event with the Information level.
Public methodStatic memberInfo(String, Object) Write a log event with the Information level.
Public methodStatic memberInfo(Exception, String, Object) Write a log event with the Information level and associated exception.
Public methodStatic memberSetSystemLogWriteProtector 
Public methodStatic memberUse 
Public methodStatic memberVerbose(String) Write a log event with the Verbose level.
Public methodStatic memberVerbose(String, Object) Write a log event with the Verbose level.
Public methodStatic memberVerbose(Exception, String, Object) Write a log event with the Verbose level and associated exception.
Public methodStatic memberWarning(String) Write a log event with the Warning level.
Public methodStatic memberWarning(String, Object) Write a log event with the Warning level.
Public methodStatic memberWarning(Exception, String, Object) Write a log event with the Warning level and associated exception.
Top
Fields
 NameDescription
Public fieldStatic memberCONTEXT 
Public fieldStatic memberCORRELATION_ID 
Public fieldStatic memberREQUEST_ID 
Top
Remarks
We use Serilog. Please look here for logging best practices.
Example
C#
Log.Error(exception, "An error has occurred when querying data objects.");
Log.Info("Found an Employee {Employee} in Department {Department}", employee, department);
See Also