Class AspNetCoreLoggerExtensions
Inheritance
Namespace:Microsoft.Extensions.Logging
Assembly:InfinniPlatform.Core.Abstractions.dll
Syntax
public static class AspNetCoreLoggerExtensions : object
Methods
| Improve this Doc View SourceGetFullMessage(Exception)
Gets a full message of the exception, including its inner exceptions.
Declaration
public static string GetFullMessage(this Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception |
Returns
Type | Description |
---|---|
System.String |
GetFullStackTrace(Exception)
Gets a full stack trace of the exception, including its inner exceptions.
Declaration
public static string GetFullStackTrace(this Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception |
Returns
Type | Description |
---|---|
System.String |
LogCritical(ILogger, Exception, Func<Dictionary<String, Object>>)
Formats and writes a critical log message.
Declaration
public static void LogCritical(this ILogger logger, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogCritical(ILogger, String, Exception, Func<Dictionary<String, Object>>)
Formats and writes a critical log message.
Declaration
public static void LogCritical(this ILogger logger, string message, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogCritical(ILogger, String, Func<Dictionary<String, Object>>)
Formats and writes a critical log message.
Declaration
public static void LogCritical(this ILogger logger, string message, Func<Dictionary<string, object>> context)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogDebug(ILogger, Exception, Func<Dictionary<String, Object>>)
Formats and writes a debug log message.
Declaration
public static void LogDebug(this ILogger logger, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogDebug(ILogger, String, Exception, Func<Dictionary<String, Object>>)
Formats and writes a debug log message.
Declaration
public static void LogDebug(this ILogger logger, string message, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogDebug(ILogger, String, Func<Dictionary<String, Object>>)
Formats and writes a debug log message.
Declaration
public static void LogDebug(this ILogger logger, string message, Func<Dictionary<string, object>> context)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogError(ILogger, Exception, Func<Dictionary<String, Object>>)
Formats and writes an error log message.
Declaration
public static void LogError(this ILogger logger, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogError(ILogger, String, Exception, Func<Dictionary<String, Object>>)
Formats and writes an error log message.
Declaration
public static void LogError(this ILogger logger, string message, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogError(ILogger, String, Func<Dictionary<String, Object>>)
Formats and writes an error log message.
Declaration
public static void LogError(this ILogger logger, string message, Func<Dictionary<string, object>> context)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogInformation(ILogger, Exception, Func<Dictionary<String, Object>>)
Formats and writes an informational log message.
Declaration
public static void LogInformation(this ILogger logger, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogInformation(ILogger, String, Exception, Func<Dictionary<String, Object>>)
Formats and writes an informational log message.
Declaration
public static void LogInformation(this ILogger logger, string message, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogInformation(ILogger, String, Func<Dictionary<String, Object>>)
Formats and writes an informational log message.
Declaration
public static void LogInformation(this ILogger logger, string message, Func<Dictionary<string, object>> context)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogWarning(ILogger, Exception, Func<Dictionary<String, Object>>)
Formats and writes a warning log message.
Declaration
public static void LogWarning(this ILogger logger, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogWarning(ILogger, String, Exception, Func<Dictionary<String, Object>>)
Formats and writes a warning log message.
Declaration
public static void LogWarning(this ILogger logger, string message, Exception exception, Func<Dictionary<string, object>> context = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Exception | exception | The exception to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |
LogWarning(ILogger, String, Func<Dictionary<String, Object>>)
Formats and writes a warning log message.
Declaration
public static void LogWarning(this ILogger logger, string message, Func<Dictionary<string, object>> context)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The |
System.String | message | The message to log. |
Func<Dictionary<System.String, System.Object>> | context | The contextual information to log. |