diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-11-21 23:57:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-21 23:57:13 +0100 |
| commit | 39e6658d01e10609c460fb92a7af583e4d04caab (patch) | |
| tree | 18f12cc9d039dc21c7d4cf95a39cfe81eb724d0b /MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs | |
| parent | 8f051c86f7d1f02c9a0d917cf0d0ed52aa88ce6b (diff) | |
| parent | ea355b4262fa0b817930d2bb751c05e6e0ee3022 (diff) | |
Merge pull request #6879 from crobibero/client-log-cleanup
Remove ClientLog endpoints
Diffstat (limited to 'MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs')
| -rw-r--r-- | MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs index 82b5b4593..dea1c2f32 100644 --- a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs +++ b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs @@ -1,48 +1,24 @@ using System; using System.IO; using System.Threading.Tasks; -using MediaBrowser.Model.ClientLog; -using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.ClientEvent { /// <inheritdoc /> public class ClientEventLogger : IClientEventLogger { - private const string LogString = "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level}] [{ClientName}:{ClientVersion}]: UserId: {UserId} DeviceId: {DeviceId}{NewLine}{Message}"; - private readonly ILogger<ClientEventLogger> _logger; private readonly IServerApplicationPaths _applicationPaths; /// <summary> /// Initializes a new instance of the <see cref="ClientEventLogger"/> class. /// </summary> - /// <param name="logger">Instance of the <see cref="ILogger{ClientEventLogger}"/> interface.</param> /// <param name="applicationPaths">Instance of the <see cref="IServerApplicationPaths"/> interface.</param> - public ClientEventLogger( - ILogger<ClientEventLogger> logger, - IServerApplicationPaths applicationPaths) + public ClientEventLogger(IServerApplicationPaths applicationPaths) { - _logger = logger; _applicationPaths = applicationPaths; } /// <inheritdoc /> - public void Log(ClientLogEvent clientLogEvent) - { - _logger.Log( - LogLevel.Critical, - LogString, - clientLogEvent.Timestamp, - clientLogEvent.Level.ToString(), - clientLogEvent.ClientName, - clientLogEvent.ClientVersion, - clientLogEvent.UserId ?? Guid.Empty, - clientLogEvent.DeviceId, - Environment.NewLine, - clientLogEvent.Message); - } - - /// <inheritdoc /> public async Task<string> WriteDocumentAsync(string clientName, string clientVersion, Stream fileContents) { var fileName = $"upload_{clientName}_{clientVersion}_{DateTime.UtcNow:yyyyMMddHHmmss}_{Guid.NewGuid():N}.log"; |
