mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
Sentry should use CleanseLogMessage.
This commit is contained in:
parent
94886e767b
commit
c9d1807670
@ -111,11 +111,18 @@ protected override void Write(LogEventInfo logEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
var extras = logEvent.Properties.ToDictionary(x => x.Key.ToString(), x => x.Value.ToString());
|
||||
var extras = logEvent.Properties.ToDictionary(x => x.Key.ToString(), x => CleanseLogMessage.Cleanse(x.Value.ToString()));
|
||||
_client.Logger = logEvent.LoggerName;
|
||||
|
||||
string cleansedMessage = CleanseLogMessage.Cleanse(logEvent.Message);
|
||||
string cleansedFormattedMessage = cleansedMessage;
|
||||
|
||||
var sentryMessage = new SentryMessage(logEvent.Message, logEvent.Parameters);
|
||||
if (logEvent.Parameters != null)
|
||||
{
|
||||
cleansedFormattedMessage = CleanseLogMessage.Cleanse(string.Format(logEvent.Message, logEvent.Parameters));
|
||||
}
|
||||
|
||||
var sentryMessage = new SentryMessage(cleansedFormattedMessage);
|
||||
|
||||
var sentryEvent = new SentryEvent(logEvent.Exception)
|
||||
{
|
||||
@ -126,7 +133,7 @@ protected override void Write(LogEventInfo logEvent)
|
||||
{
|
||||
logEvent.Level.ToString(),
|
||||
logEvent.LoggerName,
|
||||
logEvent.Message
|
||||
cleansedMessage
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user