aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-12-27 15:20:27 +0100
committerBond_009 <bond.009@outlook.com>2020-01-13 20:06:08 +0100
commit8865b3ea3d0af201c37aa129016b843f0b9fe686 (patch)
tree186d7f531ea150cfa20ae06fafcda6893a153845 /Emby.Server.Implementations/HttpServer
parent4d311870d2f40f67da6df5641b53df637fdee88d (diff)
Remove dead code and improve logging
Diffstat (limited to 'Emby.Server.Implementations/HttpServer')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs8
-rw-r--r--Emby.Server.Implementations/HttpServer/WebSocketConnection.cs4
2 files changed, 5 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index ebae4d0b1..3cdb0ecae 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -520,7 +520,7 @@ namespace Emby.Server.Implementations.HttpServer
try
{
- _logger.LogInformation("WS Request from {IP}", context.Connection.RemoteIpAddress);
+ _logger.LogInformation("WS {IP} request", context.Connection.RemoteIpAddress);
WebSocket webSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);
@@ -536,11 +536,11 @@ namespace Emby.Server.Implementations.HttpServer
WebSocketConnected?.Invoke(this, new GenericEventArgs<IWebSocketConnection>(connection));
await connection.ProcessAsync().ConfigureAwait(false);
- _logger.LogInformation("WS closed from {IP}", context.Connection.RemoteIpAddress);
+ _logger.LogInformation("WS {IP} closed", context.Connection.RemoteIpAddress);
}
catch (Exception ex) // Otherwise ASP.Net will ignore the exception
{
- _logger.LogError(ex, "WebSocketRequestHandler error");
+ _logger.LogError(ex, "WS {IP} WebSocketRequestHandler error");
if (!context.Response.HasStarted)
{
context.Response.StatusCode = 500;
@@ -705,8 +705,6 @@ namespace Emby.Server.Implementations.HttpServer
return Task.CompletedTask;
}
- _logger.LogDebug("Websocket message received: {0}", result.MessageType);
-
IEnumerable<Task> GetTasks()
{
foreach (var x in _webSocketListeners)
diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
index 913a51217..0afd0ecce 100644
--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs
@@ -195,7 +195,7 @@ namespace Emby.Server.Implementations.HttpServer
// Tell the PipeReader how much of the buffer we have consumed
reader.AdvanceTo(buffer.End);
- _logger.LogDebug("WS received message: {@Message}", stub);
+ _logger.LogDebug("WS {IP} received message: {@Message}", RemoteEndPoint, stub);
var info = new WebSocketMessageInfo
{
@@ -204,7 +204,7 @@ namespace Emby.Server.Implementations.HttpServer
Connection = this
};
- _logger.LogDebug("WS message info: {@MessageInfo}", info);
+ _logger.LogDebug("WS {IP} message info: {@MessageInfo}", RemoteEndPoint, info);
await OnReceive(info).ConfigureAwait(false);