aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2018-12-13 14:18:25 +0100
committerBond_009 <bond.009@outlook.com>2018-12-30 22:44:38 +0100
commit0f8b3c634708ce8e7b2e2ae6fed87b6b943b5bca (patch)
tree3b2440977592f46598ee1961199ec2c0fd3455ac /Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
parentb0fd432126606d7008544ff0237beabc52109e02 (diff)
Use Microsoft.Extensions.Logging abstraction
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index aa672a1b7..46fbc94fd 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Threading;
using Mono.Nat;
using System.Threading;
@@ -29,9 +29,9 @@ namespace Emby.Server.Implementations.EntryPoints
private NatManager _natManager;
- public ExternalPortForwarding(ILogManager logmanager, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
+ public ExternalPortForwarding(ILoggerFactory loggerFactory, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
{
- _logger = logmanager.GetLogger("PortMapper");
+ _logger = loggerFactory.CreateLogger("PortMapper");
_appHost = appHost;
_config = config;
_deviceDiscovery = deviceDiscovery;
@@ -84,7 +84,7 @@ namespace Emby.Server.Implementations.EntryPoints
private void Start()
{
- _logger.Debug("Starting NAT discovery");
+ _logger.LogDebug("Starting NAT discovery");
if (_natManager == null)
{
_natManager = new NatManager(_logger, _httpClient);
@@ -139,7 +139,7 @@ namespace Emby.Server.Implementations.EntryPoints
_usnsHandled.Add(identifier);
}
- _logger.Debug("Found NAT device: " + identifier);
+ _logger.LogDebug("Found NAT device: " + identifier);
IPAddress address;
if (IPAddress.TryParse(info.Location.Host, out address))
@@ -216,7 +216,7 @@ namespace Emby.Server.Implementations.EntryPoints
catch
{
// Commenting out because users are reporting problems out of our control
- //_logger.ErrorException("Error creating port forwarding rules", ex);
+ //_logger.LogError("Error creating port forwarding rules", ex);
}
}
@@ -267,7 +267,7 @@ namespace Emby.Server.Implementations.EntryPoints
private Task CreatePortMap(INatDevice device, int privatePort, int publicPort)
{
- _logger.Debug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
+ _logger.LogDebug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
return device.CreatePortMap(new Mapping(Protocol.Tcp, privatePort, publicPort)
{
@@ -284,7 +284,7 @@ namespace Emby.Server.Implementations.EntryPoints
private void DisposeNat()
{
- _logger.Debug("Stopping NAT discovery");
+ _logger.LogDebug("Stopping NAT discovery");
if (_timer != null)
{
@@ -309,7 +309,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error stopping NAT Discovery", ex);
+ _logger.LogError("Error stopping NAT Discovery", ex);
}
}
}