-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisCacheLogger.cs
More file actions
32 lines (24 loc) · 2.45 KB
/
Copy pathRedisCacheLogger.cs
File metadata and controls
32 lines (24 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Net;
using Microsoft.Extensions.Logging;
using StackExchange.Redis;
namespace Sagara.Core.Caching;
/// <summary>
/// High-performance logging for ASP.NET Core. See: https://learn.microsoft.com/en-us/dotnet/core/extensions/logger-message-generator
/// </summary>
internal static partial class RedisCacheLogger
{
[LoggerMessage(Level = LogLevel.Error, Message = "{LogPrefix}ConnectionFailed: Connection type '{ConnectionType}' on EndPoint '{EndPoint}' reported ConnectionFailureType '{FailureType}'")]
public static partial void Error_OnConnectionFailed(this ILogger logger, Exception? ex, string logPrefix, ConnectionType connectionType, EndPoint? endPoint, ConnectionFailureType failureType);
[LoggerMessage(Level = LogLevel.Information, Message = "{LogPrefix}ConnectionRestored: Connection type '{ConnectionType}' on EndPoint '{EndPoint}' reported ConnectionFailureType '{FailureType}'")]
public static partial void Information_OnConnectionRestored(this ILogger logger, Exception? ex, string logPrefix, ConnectionType connectionType, EndPoint? endPoint, ConnectionFailureType failureType);
[LoggerMessage(Level = LogLevel.Error, Message = "{LogPrefix}ErrorMessage: Server '{EndPoint}' reported this error message: {Message}")]
public static partial void Error_OnErrorMessage(this ILogger logger, string logPrefix, EndPoint? endPoint, string message);
[LoggerMessage(Level = LogLevel.Warning, Message = "{LogPrefix}ServerMaintenanceEvent: Server maintenance event received at {ReceivedTimeUtc}. Expected start time is {StartTimeUtc}. Raw message: {RawMessage}")]
public static partial void Warning_OnServerMaintenanceEvent(this ILogger logger, string logPrefix, DateTime receivedTimeUtc, DateTime? startTimeUtc, string? rawMessage);
[LoggerMessage(Level = LogLevel.Error, Message = "Unhandled exception trying to async {Command} {Key}")]
public static partial void Error_UnhandledException(this ILogger logger, Exception ex, string command, string key);
[LoggerMessage(Level = LogLevel.Error, Message = "Unhandled exception trying to SUBSCRIBE {Channel}")]
public static partial void Error_UnhandledSubscribeException(this ILogger logger, Exception ex, RedisChannel channel);
[LoggerMessage(Level = LogLevel.Error, Message = "Unhandled exception trying to async PUBLISH {Channel} {Message}")]
public static partial void Error_UnhandledPublishException(this ILogger logger, Exception ex, RedisChannel channel, RedisValue message);
}