Class ApplicationLogging
Helper class for logging all actions in the LemonEdge platform
Inheritance
System.Object
ApplicationLogging
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: LemonEdge.Utils
Assembly: Utils.dll
Syntax
public static class ApplicationLogging
Properties
HasAzureFunctionLogger
Indicates if we are using an azure logger
Declaration
public static bool HasAzureFunctionLogger { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LoggerFactory
The logger factory to use for logging
Declaration
public static ILoggerFactory LoggerFactory { get; set; }
Property Value
Type | Description |
---|---|
ILoggerFactory |
Methods
ConfigureLogger(ILoggerFactory)
Configurs the logger to use the specified
Declaration
public static void ConfigureLogger(ILoggerFactory factory)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | factory | The factory to use for logging |
CreateLogger<T>()
Creates an instance of a logger for logging application details
Declaration
public static ILogger CreateLogger<T>()
Returns
Type | Description |
---|---|
ILogger | A new ILogger for logging with |
Type Parameters
Name | Description |
---|---|
T | The type the logger is active agaisnt |
ForceCreateLoggerFactory()
Recreates and reconfigures the logging factory loading in any new settins changes
Declaration
public static void ForceCreateLoggerFactory()
SetAzureFunctionLogger(ILogger)
Sets the logger in place of all others when running from within an azure serverless function
Declaration
public static void SetAzureFunctionLogger(ILogger azureFunctionLogger)
Parameters
Type | Name | Description |
---|---|---|
ILogger | azureFunctionLogger | The logger to always use |
Remarks
Not perfect as service will be using wrong logger as function is called twice or more from diff threads, but at least we can get stuff out