|
@@ -80,7 +80,7 @@ using MediaBrowser.Model.Dlna;
|
|
|
using MediaBrowser.Model.Events;
|
|
|
using MediaBrowser.Model.Globalization;
|
|
|
using MediaBrowser.Model.IO;
|
|
|
-using MediaBrowser.Model.Logging;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
using MediaBrowser.Model.MediaInfo;
|
|
|
using MediaBrowser.Model.Net;
|
|
|
using MediaBrowser.Model.News;
|
|
@@ -202,10 +202,10 @@ namespace Emby.Server.Implementations
|
|
|
public IPlugin[] Plugins { get; protected set; }
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Gets or sets the log manager.
|
|
|
+ /// Gets or sets the logger factory.
|
|
|
/// </summary>
|
|
|
- /// <value>The log manager.</value>
|
|
|
- public ILogManager LogManager { get; protected set; }
|
|
|
+ /// <value>The logger factory.</value>
|
|
|
+ public ILoggerFactory LoggerFactory { get; protected set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// Gets the application paths.
|
|
@@ -275,12 +275,12 @@ namespace Emby.Server.Implementations
|
|
|
/// <returns>IConfigurationManager.</returns>
|
|
|
protected IConfigurationManager GetConfigurationManager()
|
|
|
{
|
|
|
- return new ServerConfigurationManager(ApplicationPaths, LogManager, XmlSerializer, FileSystemManager);
|
|
|
+ return new ServerConfigurationManager(ApplicationPaths, LoggerFactory, XmlSerializer, FileSystemManager);
|
|
|
}
|
|
|
|
|
|
protected virtual IResourceFileManager CreateResourceFileManager()
|
|
|
{
|
|
|
- return new ResourceFileManager(HttpResultFactory, LogManager.GetLogger("ResourceManager"), FileSystemManager);
|
|
|
+ return new ResourceFileManager(HttpResultFactory, LoggerFactory.CreateLogger("ResourceManager"), FileSystemManager);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -391,7 +391,7 @@ namespace Emby.Server.Implementations
|
|
|
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
|
|
|
/// </summary>
|
|
|
public ApplicationHost(ServerApplicationPaths applicationPaths,
|
|
|
- ILogManager logManager,
|
|
|
+ ILoggerFactory loggerFactory,
|
|
|
StartupOptions options,
|
|
|
IFileSystem fileSystem,
|
|
|
IPowerManagement powerManagement,
|
|
@@ -405,7 +405,7 @@ namespace Emby.Server.Implementations
|
|
|
// hack alert, until common can target .net core
|
|
|
BaseExtensions.CryptographyProvider = CryptographyProvider;
|
|
|
|
|
|
- XmlSerializer = new MyXmlSerializer(fileSystem, logManager.GetLogger("XmlSerializer"));
|
|
|
+ XmlSerializer = new MyXmlSerializer(fileSystem, LoggerFactory.CreateLogger("XmlSerializer"));
|
|
|
|
|
|
NetworkManager = networkManager;
|
|
|
networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets;
|
|
@@ -413,13 +413,13 @@ namespace Emby.Server.Implementations
|
|
|
SystemEvents = systemEvents;
|
|
|
|
|
|
ApplicationPaths = applicationPaths;
|
|
|
- LogManager = logManager;
|
|
|
+ LoggerFactory = loggerFactory;
|
|
|
FileSystemManager = fileSystem;
|
|
|
|
|
|
ConfigurationManager = GetConfigurationManager();
|
|
|
|
|
|
// Initialize this early in case the -v command line option is used
|
|
|
- Logger = LogManager.GetLogger("App");
|
|
|
+ Logger = LoggerFactory.CreateLogger("App");
|
|
|
|
|
|
StartupOptions = options;
|
|
|
ReleaseAssetFilename = releaseAssetFilename;
|
|
@@ -427,7 +427,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
ImageEncoder = imageEncoder;
|
|
|
|
|
|
- SetBaseExceptionMessage();
|
|
|
+ //SetBaseExceptionMessage();
|
|
|
|
|
|
fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));
|
|
|
|
|
@@ -480,7 +480,7 @@ namespace Emby.Server.Implementations
|
|
|
{
|
|
|
if (_deviceId == null)
|
|
|
{
|
|
|
- _deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), FileSystemManager);
|
|
|
+ _deviceId = new DeviceId(ApplicationPaths, LoggerFactory.CreateLogger("SystemId"), FileSystemManager);
|
|
|
}
|
|
|
|
|
|
return _deviceId.Value;
|
|
@@ -545,7 +545,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error creating {0}", ex, type.FullName);
|
|
|
+ Logger.LogError("Error creating {0}", ex, type.FullName);
|
|
|
// Don't blow up in release mode
|
|
|
return null;
|
|
|
}
|
|
@@ -625,7 +625,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error loading assembly {0}", ex, file);
|
|
|
+ Logger.LogError("Error loading assembly {0}", ex, file);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
@@ -693,7 +693,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
return parts;
|
|
|
}
|
|
|
-
|
|
|
+ /*/
|
|
|
private void SetBaseExceptionMessage()
|
|
|
{
|
|
|
var builder = GetBaseExceptionMessage(ApplicationPaths);
|
|
@@ -701,8 +701,8 @@ namespace Emby.Server.Implementations
|
|
|
builder.Insert(0, string.Format("Version: {0}{1}", ApplicationVersion, Environment.NewLine));
|
|
|
builder.Insert(0, "*** Error Report ***" + Environment.NewLine);
|
|
|
|
|
|
- LogManager.ExceptionMessagePrefix = builder.ToString();
|
|
|
- }
|
|
|
+ LoggerFactory.ExceptionMessagePrefix = builder.ToString();
|
|
|
+ }*/
|
|
|
|
|
|
/// <summary>
|
|
|
/// Runs the startup tasks.
|
|
@@ -726,20 +726,20 @@ namespace Emby.Server.Implementations
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
- Logger.Info("ServerId: {0}", SystemId);
|
|
|
+ Logger.LogInformation("ServerId: {0}", SystemId);
|
|
|
|
|
|
var entryPoints = GetExports<IServerEntryPoint>();
|
|
|
RunEntryPoints(entryPoints, true);
|
|
|
|
|
|
- Logger.Info("Core startup complete");
|
|
|
+ Logger.LogInformation("Core startup complete");
|
|
|
HttpServer.GlobalResponse = null;
|
|
|
|
|
|
- Logger.Info("Post-init migrations complete");
|
|
|
+ Logger.LogInformation("Post-init migrations complete");
|
|
|
|
|
|
RunEntryPoints(entryPoints, false);
|
|
|
- Logger.Info("All entry points have started");
|
|
|
+ Logger.LogInformation("All entry points have started");
|
|
|
|
|
|
- LogManager.RemoveConsoleOutput();
|
|
|
+ //LoggerFactory.RemoveConsoleOutput();
|
|
|
}
|
|
|
|
|
|
private void RunEntryPoints(IEnumerable<IServerEntryPoint> entryPoints, bool isBeforeStartup)
|
|
@@ -752,7 +752,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
|
|
|
var name = entryPoint.GetType().FullName;
|
|
|
- Logger.Info("Starting entry point {0}", name);
|
|
|
+ Logger.LogInformation("Starting entry point {0}", name);
|
|
|
var now = DateTime.UtcNow;
|
|
|
try
|
|
|
{
|
|
@@ -760,9 +760,9 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error in {0}", ex, name);
|
|
|
+ Logger.LogError("Error in {0}", ex, name);
|
|
|
}
|
|
|
- Logger.Info("Entry point completed: {0}. Duration: {1} seconds", name, (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture), "ImageInfos");
|
|
|
+ Logger.LogInformation("Entry point completed: {0}. Duration: {1} seconds", name, (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture), "ImageInfos");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -777,13 +777,13 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error configuring autorun", ex);
|
|
|
+ Logger.LogError("Error configuring autorun", ex);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private IJsonSerializer CreateJsonSerializer()
|
|
|
{
|
|
|
- return new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer"));
|
|
|
+ return new JsonSerializer(FileSystemManager, LoggerFactory.CreateLogger("JsonSerializer"));
|
|
|
}
|
|
|
|
|
|
public void Init()
|
|
@@ -799,13 +799,13 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
|
|
|
JsonSerializer = CreateJsonSerializer();
|
|
|
-
|
|
|
+ /*
|
|
|
OnLoggerLoaded(true);
|
|
|
- LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
|
|
+ LoggerFactory.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
|
|
|
|
|
- LogManager.LogSeverity = ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
|
|
|
+ LoggerFactory.LogSeverity = ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
|
|
|
? LogSeverity.Debug
|
|
|
- : LogSeverity.Info;
|
|
|
+ : LogSeverity.Info;*/
|
|
|
|
|
|
DiscoverTypes();
|
|
|
|
|
@@ -815,10 +815,10 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
FindParts();
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
protected virtual void OnLoggerLoaded(bool isFirstLoad)
|
|
|
{
|
|
|
- Logger.Info("Application version: {0}", ApplicationVersion);
|
|
|
+ Logger.LogInformation("Application version: {0}", ApplicationVersion);
|
|
|
|
|
|
if (!isFirstLoad)
|
|
|
{
|
|
@@ -836,11 +836,11 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
Logger.LogMultiline("Plugins:", LogSeverity.Info, pluginBuilder);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
protected virtual IHttpClient CreateHttpClient()
|
|
|
{
|
|
|
- return new HttpClientManager.HttpClientManager(ApplicationPaths, LogManager.GetLogger("HttpClient"), FileSystemManager, GetDefaultUserAgent);
|
|
|
+ return new HttpClientManager.HttpClientManager(ApplicationPaths, LoggerFactory.CreateLogger("HttpClient"), FileSystemManager, GetDefaultUserAgent);
|
|
|
}
|
|
|
|
|
|
public static IStreamHelper StreamHelper { get; set; }
|
|
@@ -858,7 +858,7 @@ namespace Emby.Server.Implementations
|
|
|
RegisterSingleInstance(JsonSerializer);
|
|
|
RegisterSingleInstance(SystemEvents);
|
|
|
|
|
|
- RegisterSingleInstance(LogManager, false);
|
|
|
+ RegisterSingleInstance(LoggerFactory, false);
|
|
|
RegisterSingleInstance(Logger);
|
|
|
|
|
|
RegisterSingleInstance(EnvironmentInfo);
|
|
@@ -873,7 +873,7 @@ namespace Emby.Server.Implementations
|
|
|
IsoManager = new IsoManager();
|
|
|
RegisterSingleInstance(IsoManager);
|
|
|
|
|
|
- TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LogManager.GetLogger("TaskManager"), FileSystemManager, SystemEvents);
|
|
|
+ TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LoggerFactory.CreateLogger("TaskManager"), FileSystemManager, SystemEvents);
|
|
|
RegisterSingleInstance(TaskManager);
|
|
|
|
|
|
RegisterSingleInstance(XmlSerializer);
|
|
@@ -890,21 +890,21 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
RegisterSingleInstance(CryptographyProvider);
|
|
|
|
|
|
- SocketFactory = new SocketFactory(LogManager.GetLogger("SocketFactory"));
|
|
|
+ SocketFactory = new SocketFactory(LoggerFactory.CreateLogger("SocketFactory"));
|
|
|
RegisterSingleInstance(SocketFactory);
|
|
|
|
|
|
RegisterSingleInstance(PowerManagement);
|
|
|
|
|
|
- SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LogManager, FileSystemManager, CryptographyProvider);
|
|
|
+ SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LoggerFactory, FileSystemManager, CryptographyProvider);
|
|
|
RegisterSingleInstance(SecurityManager);
|
|
|
|
|
|
- InstallationManager = new InstallationManager(LogManager.GetLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
|
|
+ InstallationManager = new InstallationManager(LoggerFactory.CreateLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
|
|
RegisterSingleInstance(InstallationManager);
|
|
|
|
|
|
ZipClient = new ZipClient(FileSystemManager);
|
|
|
RegisterSingleInstance(ZipClient);
|
|
|
|
|
|
- HttpResultFactory = new HttpResultFactory(LogManager, FileSystemManager, JsonSerializer, CreateBrotliCompressor());
|
|
|
+ HttpResultFactory = new HttpResultFactory(LoggerFactory, FileSystemManager, JsonSerializer, CreateBrotliCompressor());
|
|
|
RegisterSingleInstance(HttpResultFactory);
|
|
|
|
|
|
RegisterSingleInstance<IServerApplicationHost>(this);
|
|
@@ -915,36 +915,40 @@ namespace Emby.Server.Implementations
|
|
|
IAssemblyInfo assemblyInfo = new AssemblyInfo();
|
|
|
RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
|
|
|
|
|
|
- LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
|
|
|
+ LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LoggerFactory.CreateLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
|
|
|
StringExtensions.LocalizationManager = LocalizationManager;
|
|
|
RegisterSingleInstance(LocalizationManager);
|
|
|
|
|
|
- TextEncoding = new TextEncoding.TextEncoding(FileSystemManager, LogManager.GetLogger("TextEncoding"), JsonSerializer);
|
|
|
+ TextEncoding = new TextEncoding.TextEncoding(FileSystemManager, LoggerFactory.CreateLogger("TextEncoding"), JsonSerializer);
|
|
|
RegisterSingleInstance(TextEncoding);
|
|
|
BlurayExaminer = new BdInfoExaminer(FileSystemManager, TextEncoding);
|
|
|
RegisterSingleInstance(BlurayExaminer);
|
|
|
|
|
|
RegisterSingleInstance<IXmlReaderSettingsFactory>(new XmlReaderSettingsFactory());
|
|
|
|
|
|
- UserDataManager = new UserDataManager(LogManager, ServerConfigurationManager, () => UserManager);
|
|
|
+ UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager);
|
|
|
RegisterSingleInstance(UserDataManager);
|
|
|
|
|
|
UserRepository = GetUserRepository();
|
|
|
// This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it
|
|
|
RegisterSingleInstance(UserRepository);
|
|
|
|
|
|
- var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager.GetLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, FileSystemManager);
|
|
|
+ var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory.CreateLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, FileSystemManager);
|
|
|
DisplayPreferencesRepository = displayPreferencesRepo;
|
|
|
RegisterSingleInstance(DisplayPreferencesRepository);
|
|
|
|
|
|
- var itemRepo = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LogManager.GetLogger("SqliteItemRepository"), assemblyInfo, FileSystemManager, EnvironmentInfo, TimerFactory);
|
|
|
+ var itemRepo = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory.CreateLogger("SqliteItemRepository"), assemblyInfo, FileSystemManager, EnvironmentInfo, TimerFactory);
|
|
|
ItemRepository = itemRepo;
|
|
|
RegisterSingleInstance(ItemRepository);
|
|
|
|
|
|
AuthenticationRepository = GetAuthenticationRepository();
|
|
|
RegisterSingleInstance(AuthenticationRepository);
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager, CryptographyProvider);
|
|
|
+=======
|
|
|
+ UserManager = new UserManager(LoggerFactory.CreateLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, () => ConnectManager, this, JsonSerializer, FileSystemManager, CryptographyProvider);
|
|
|
+>>>>>>> Use Microsoft.Extensions.Logging abstraction
|
|
|
RegisterSingleInstance(UserManager);
|
|
|
|
|
|
LibraryManager = new LibraryManager(this, Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager);
|
|
@@ -953,16 +957,16 @@ namespace Emby.Server.Implementations
|
|
|
var musicManager = new MusicManager(LibraryManager);
|
|
|
RegisterSingleInstance<IMusicManager>(new MusicManager(LibraryManager));
|
|
|
|
|
|
- LibraryMonitor = new LibraryMonitor(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, TimerFactory, SystemEvents, EnvironmentInfo);
|
|
|
+ LibraryMonitor = new LibraryMonitor(LoggerFactory, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, TimerFactory, SystemEvents, EnvironmentInfo);
|
|
|
RegisterSingleInstance(LibraryMonitor);
|
|
|
|
|
|
- RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager));
|
|
|
+ RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LoggerFactory, LibraryManager, UserManager));
|
|
|
|
|
|
CertificateInfo = GetCertificateInfo(true);
|
|
|
Certificate = GetCertificate(CertificateInfo);
|
|
|
|
|
|
HttpServer = new HttpListenerHost(this,
|
|
|
- LogManager.GetLogger("HttpServer"),
|
|
|
+ LoggerFactory.CreateLogger("HttpServer"),
|
|
|
ServerConfigurationManager,
|
|
|
"web/index.html",
|
|
|
NetworkManager,
|
|
@@ -983,37 +987,37 @@ namespace Emby.Server.Implementations
|
|
|
var encryptionManager = new EncryptionManager();
|
|
|
RegisterSingleInstance<IEncryptionManager>(encryptionManager);
|
|
|
|
|
|
- DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager);
|
|
|
+ DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LoggerFactory.CreateLogger("DeviceManager"), NetworkManager);
|
|
|
RegisterSingleInstance(DeviceManager);
|
|
|
|
|
|
var newsService = new Emby.Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
|
|
|
RegisterSingleInstance<INewsService>(newsService);
|
|
|
|
|
|
- MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder);
|
|
|
+ MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory.CreateLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder);
|
|
|
RegisterSingleInstance(MediaSourceManager);
|
|
|
|
|
|
- SubtitleManager = new SubtitleManager(LogManager.GetLogger("SubtitleManager"), FileSystemManager, LibraryMonitor, MediaSourceManager, ServerConfigurationManager, LocalizationManager);
|
|
|
+ SubtitleManager = new SubtitleManager(LoggerFactory.CreateLogger("SubtitleManager"), FileSystemManager, LibraryMonitor, MediaSourceManager, ServerConfigurationManager, LocalizationManager);
|
|
|
RegisterSingleInstance(SubtitleManager);
|
|
|
|
|
|
- ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LogManager, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer);
|
|
|
+ ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LoggerFactory, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer);
|
|
|
RegisterSingleInstance(ProviderManager);
|
|
|
|
|
|
- DtoService = new DtoService(LogManager.GetLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager);
|
|
|
+ DtoService = new DtoService(LoggerFactory.CreateLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager);
|
|
|
RegisterSingleInstance(DtoService);
|
|
|
|
|
|
- ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LogManager.GetLogger("ChannelManager"), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager);
|
|
|
+ ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LoggerFactory.CreateLogger("ChannelManager"), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager);
|
|
|
RegisterSingleInstance(ChannelManager);
|
|
|
|
|
|
- SessionManager = new SessionManager(UserDataManager, LogManager.GetLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager, TimerFactory);
|
|
|
+ SessionManager = new SessionManager(UserDataManager, LoggerFactory.CreateLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager, TimerFactory);
|
|
|
RegisterSingleInstance(SessionManager);
|
|
|
|
|
|
- var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer, this, assemblyInfo);
|
|
|
+ var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LoggerFactory.CreateLogger("Dlna"), JsonSerializer, this, assemblyInfo);
|
|
|
RegisterSingleInstance<IDlnaManager>(dlnaManager);
|
|
|
|
|
|
- CollectionManager = new CollectionManager(LibraryManager, ApplicationPaths, LocalizationManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"), ProviderManager);
|
|
|
+ CollectionManager = new CollectionManager(LibraryManager, ApplicationPaths, LocalizationManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("CollectionManager"), ProviderManager);
|
|
|
RegisterSingleInstance(CollectionManager);
|
|
|
|
|
|
- PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager, ProviderManager);
|
|
|
+ PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("PlaylistManager"), UserManager, ProviderManager);
|
|
|
RegisterSingleInstance<IPlaylistManager>(PlaylistManager);
|
|
|
|
|
|
LiveTvManager = new LiveTvManager(this, HttpClient, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager, SecurityManager, () => ChannelManager);
|
|
@@ -1022,12 +1026,12 @@ namespace Emby.Server.Implementations
|
|
|
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
|
|
|
RegisterSingleInstance(UserViewManager);
|
|
|
|
|
|
- NotificationManager = new NotificationManager(LogManager, UserManager, ServerConfigurationManager);
|
|
|
+ NotificationManager = new NotificationManager(LoggerFactory, UserManager, ServerConfigurationManager);
|
|
|
RegisterSingleInstance(NotificationManager);
|
|
|
|
|
|
- RegisterSingleInstance<IDeviceDiscovery>(new DeviceDiscovery(LogManager.GetLogger("IDeviceDiscovery"), ServerConfigurationManager, SocketFactory, TimerFactory));
|
|
|
+ RegisterSingleInstance<IDeviceDiscovery>(new DeviceDiscovery(LoggerFactory.CreateLogger("IDeviceDiscovery"), ServerConfigurationManager, SocketFactory, TimerFactory));
|
|
|
|
|
|
- ChapterManager = new ChapterManager(LibraryManager, LogManager.GetLogger("ChapterManager"), ServerConfigurationManager, ItemRepository);
|
|
|
+ ChapterManager = new ChapterManager(LibraryManager, LoggerFactory.CreateLogger("ChapterManager"), ServerConfigurationManager, ItemRepository);
|
|
|
RegisterSingleInstance(ChapterManager);
|
|
|
|
|
|
RegisterMediaEncoder(assemblyInfo);
|
|
@@ -1037,7 +1041,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
var activityLogRepo = GetActivityLogRepository();
|
|
|
RegisterSingleInstance(activityLogRepo);
|
|
|
- RegisterSingleInstance<IActivityManager>(new ActivityManager(LogManager.GetLogger("ActivityManager"), activityLogRepo, UserManager));
|
|
|
+ RegisterSingleInstance<IActivityManager>(new ActivityManager(LoggerFactory.CreateLogger("ActivityManager"), activityLogRepo, UserManager));
|
|
|
|
|
|
var authContext = new AuthorizationContext(AuthenticationRepository, UserManager);
|
|
|
RegisterSingleInstance<IAuthorizationContext>(authContext);
|
|
@@ -1046,14 +1050,14 @@ namespace Emby.Server.Implementations
|
|
|
AuthService = new AuthService(UserManager, authContext, ServerConfigurationManager, SessionManager, NetworkManager);
|
|
|
RegisterSingleInstance<IAuthService>(AuthService);
|
|
|
|
|
|
- SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(LibraryManager, LogManager.GetLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager, ProcessFactory, TextEncoding);
|
|
|
+ SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(LibraryManager, LoggerFactory.CreateLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager, ProcessFactory, TextEncoding);
|
|
|
RegisterSingleInstance(SubtitleEncoder);
|
|
|
|
|
|
RegisterSingleInstance(CreateResourceFileManager());
|
|
|
|
|
|
displayPreferencesRepo.Initialize();
|
|
|
|
|
|
- var userDataRepo = new SqliteUserDataRepository(LogManager.GetLogger("SqliteUserDataRepository"), ApplicationPaths, FileSystemManager);
|
|
|
+ var userDataRepo = new SqliteUserDataRepository(LoggerFactory.CreateLogger("SqliteUserDataRepository"), ApplicationPaths, FileSystemManager);
|
|
|
|
|
|
SetStaticProperties();
|
|
|
|
|
@@ -1082,9 +1086,9 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, bool isStartup)
|
|
|
+ public static void LogEnvironmentInfo(ILogger Logger, IApplicationPaths appPaths, bool isStartup)
|
|
|
{
|
|
|
- logger.LogMultiline("Emby", LogSeverity.Info, GetBaseExceptionMessage(appPaths));
|
|
|
+ Logger.LogInformation("Jellyfin:\n{ex}", GetBaseExceptionMessage(appPaths).ToString());
|
|
|
}
|
|
|
|
|
|
protected static StringBuilder GetBaseExceptionMessage(IApplicationPaths appPaths)
|
|
@@ -1103,17 +1107,6 @@ namespace Emby.Server.Implementations
|
|
|
builder.AppendLine(string.Format("64-Bit OS: {0}", Environment.Is64BitOperatingSystem));
|
|
|
builder.AppendLine(string.Format("64-Bit Process: {0}", Environment.Is64BitProcess));
|
|
|
builder.AppendLine(string.Format("User Interactive: {0}", Environment.UserInteractive));
|
|
|
-
|
|
|
- Type type = Type.GetType("Mono.Runtime");
|
|
|
- if (type != null)
|
|
|
- {
|
|
|
- MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
|
|
- if (displayName != null)
|
|
|
- {
|
|
|
- builder.AppendLine("Mono: " + displayName.Invoke(null, null));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
builder.AppendLine(string.Format("Processor count: {0}", Environment.ProcessorCount));
|
|
|
builder.AppendLine(string.Format("Program data path: {0}", appPaths.ProgramDataPath));
|
|
|
builder.AppendLine(string.Format("Application directory: {0}", appPaths.ProgramSystemPath));
|
|
@@ -1130,7 +1123,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error setting http limit", ex);
|
|
|
+ Logger.LogError("Error setting http limit", ex);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1189,7 +1182,7 @@ namespace Emby.Server.Implementations
|
|
|
//localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
|
|
|
if (!localCert.HasPrivateKey)
|
|
|
{
|
|
|
- Logger.Error("No private key included in SSL cert {0}.", certificateLocation);
|
|
|
+ Logger.LogError("No private key included in SSL cert {0}.", certificateLocation);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -1197,14 +1190,14 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error loading cert from {0}", ex, certificateLocation);
|
|
|
+ Logger.LogError("Error loading cert from {0}", ex, certificateLocation);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private IImageProcessor GetImageProcessor()
|
|
|
{
|
|
|
- return new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, ImageEncoder, () => LibraryManager, TimerFactory, () => MediaEncoder);
|
|
|
+ return new ImageProcessor(LoggerFactory.CreateLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, ImageEncoder, () => LibraryManager, TimerFactory, () => MediaEncoder);
|
|
|
}
|
|
|
|
|
|
protected virtual FFMpegInstallInfo GetFfmpegInstallInfo()
|
|
@@ -1262,7 +1255,8 @@ namespace Emby.Server.Implementations
|
|
|
probePath = info.ProbePath;
|
|
|
var hasExternalEncoder = string.Equals(info.Version, "external", StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
- var mediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(LogManager.GetLogger("MediaEncoder"),
|
|
|
+ var mediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
|
|
+ LoggerFactory.CreateLogger("MediaEncoder"),
|
|
|
JsonSerializer,
|
|
|
encoderPath,
|
|
|
probePath,
|
|
@@ -1292,7 +1286,7 @@ namespace Emby.Server.Implementations
|
|
|
/// <returns>Task{IUserRepository}.</returns>
|
|
|
private IUserRepository GetUserRepository()
|
|
|
{
|
|
|
- var repo = new SqliteUserRepository(LogManager.GetLogger("SqliteUserRepository"), ApplicationPaths, JsonSerializer);
|
|
|
+ var repo = new SqliteUserRepository(LoggerFactory.CreateLogger("SqliteUserRepository"), ApplicationPaths, JsonSerializer);
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
@@ -1301,7 +1295,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
private IAuthenticationRepository GetAuthenticationRepository()
|
|
|
{
|
|
|
- var repo = new AuthenticationRepository(LogManager.GetLogger("AuthenticationRepository"), ServerConfigurationManager);
|
|
|
+ var repo = new AuthenticationRepository(LoggerFactory.CreateLogger("AuthenticationRepository"), ServerConfigurationManager);
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
@@ -1310,7 +1304,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
private IActivityRepository GetActivityLogRepository()
|
|
|
{
|
|
|
- var repo = new ActivityRepository(LogManager.GetLogger("ActivityRepository"), ServerConfigurationManager.ApplicationPaths, FileSystemManager);
|
|
|
+ var repo = new ActivityRepository(LoggerFactory.CreateLogger("ActivityRepository"), ServerConfigurationManager.ApplicationPaths, FileSystemManager);
|
|
|
|
|
|
repo.Initialize();
|
|
|
|
|
@@ -1325,7 +1319,7 @@ namespace Emby.Server.Implementations
|
|
|
((SqliteItemRepository)ItemRepository).ImageProcessor = ImageProcessor;
|
|
|
|
|
|
// For now there's no real way to inject these properly
|
|
|
- BaseItem.Logger = LogManager.GetLogger("BaseItem");
|
|
|
+ BaseItem.Logger = LoggerFactory.CreateLogger("BaseItem");
|
|
|
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
|
|
BaseItem.LibraryManager = LibraryManager;
|
|
|
BaseItem.ProviderManager = ProviderManager;
|
|
@@ -1425,7 +1419,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error getting plugin Id from {0}.", ex, plugin.GetType().FullName);
|
|
|
+ Logger.LogError("Error getting plugin Id from {0}.", ex, plugin.GetType().FullName);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1437,7 +1431,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error loading plugin {0}", ex, plugin.GetType().FullName);
|
|
|
+ Logger.LogError("Error loading plugin {0}", ex, plugin.GetType().FullName);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -1449,7 +1443,7 @@ namespace Emby.Server.Implementations
|
|
|
/// </summary>
|
|
|
protected void DiscoverTypes()
|
|
|
{
|
|
|
- Logger.Info("Loading assemblies");
|
|
|
+ Logger.LogInformation("Loading assemblies");
|
|
|
|
|
|
var assemblyInfos = GetComposablePartAssemblies();
|
|
|
|
|
@@ -1460,11 +1454,11 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
if (path == null)
|
|
|
{
|
|
|
- Logger.Info("Loading {0}", assembly.FullName);
|
|
|
+ Logger.LogInformation("Loading {0}", assembly.FullName);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Logger.Info("Loading {0} from {1}", assembly.FullName, path);
|
|
|
+ Logger.LogInformation("Loading {0} from {1}", assembly.FullName, path);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1506,7 +1500,7 @@ namespace Emby.Server.Implementations
|
|
|
{
|
|
|
if (loaderException != null)
|
|
|
{
|
|
|
- Logger.Error("LoaderException: " + loaderException.Message);
|
|
|
+ Logger.LogError("LoaderException: " + loaderException.Message);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1517,7 +1511,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error loading types from assembly", ex);
|
|
|
+ Logger.LogError("Error loading types from assembly", ex);
|
|
|
|
|
|
return new List<Tuple<Type, string>>();
|
|
|
}
|
|
@@ -1564,7 +1558,7 @@ namespace Emby.Server.Implementations
|
|
|
? "The http server is unable to start due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system."
|
|
|
: "Error starting Http Server";
|
|
|
|
|
|
- Logger.ErrorException(msg, ex);
|
|
|
+ Logger.LogError(msg, ex);
|
|
|
|
|
|
if (HttpPort == ServerConfiguration.DefaultHttpPort)
|
|
|
{
|
|
@@ -1580,7 +1574,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error starting http server", ex);
|
|
|
+ Logger.LogError("Error starting http server", ex);
|
|
|
|
|
|
throw;
|
|
|
}
|
|
@@ -1615,7 +1609,7 @@ namespace Emby.Server.Implementations
|
|
|
// }
|
|
|
// catch (Exception ex)
|
|
|
// {
|
|
|
- // Logger.ErrorException("Error creating ssl cert", ex);
|
|
|
+ // Logger.LogError("Error creating ssl cert", ex);
|
|
|
// return null;
|
|
|
// }
|
|
|
// }
|
|
@@ -1672,7 +1666,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
if (requiresRestart)
|
|
|
{
|
|
|
- Logger.Info("App needs to be restarted due to configuration change.");
|
|
|
+ Logger.LogInformation("App needs to be restarted due to configuration change.");
|
|
|
|
|
|
NotifyPendingRestart();
|
|
|
}
|
|
@@ -1683,7 +1677,7 @@ namespace Emby.Server.Implementations
|
|
|
/// </summary>
|
|
|
public void NotifyPendingRestart()
|
|
|
{
|
|
|
- Logger.Info("App needs to be restarted.");
|
|
|
+ Logger.LogInformation("App needs to be restarted.");
|
|
|
|
|
|
var changed = !HasPendingRestart;
|
|
|
|
|
@@ -1720,10 +1714,10 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error sending server restart notification", ex);
|
|
|
+ Logger.LogError("Error sending server restart notification", ex);
|
|
|
}
|
|
|
|
|
|
- Logger.Info("Calling RestartInternal");
|
|
|
+ Logger.LogInformation("Calling RestartInternal");
|
|
|
|
|
|
RestartInternal();
|
|
|
});
|
|
@@ -1849,13 +1843,13 @@ namespace Emby.Server.Implementations
|
|
|
{
|
|
|
var result = Version.Parse(FileVersionInfo.GetVersionInfo(path).FileVersion);
|
|
|
|
|
|
- Logger.Info("File {0} has version {1}", path, result);
|
|
|
+ Logger.LogInformation("File {0} has version {1}", path, result);
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error getting version number from {0}", ex, path);
|
|
|
+ Logger.LogError("Error getting version number from {0}", ex, path);
|
|
|
|
|
|
return new Version(1, 0);
|
|
|
}
|
|
@@ -1940,13 +1934,13 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
if (version < minRequiredVersion)
|
|
|
{
|
|
|
- Logger.Info("Not loading {0} {1} because the minimum supported version is {2}. Please update to the newer version", filename, version, minRequiredVersion);
|
|
|
+ Logger.LogInformation("Not loading {0} {1} because the minimum supported version is {2}. Please update to the newer version", filename, version, minRequiredVersion);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error getting version number from {0}", ex, path);
|
|
|
+ Logger.LogError("Error getting version number from {0}", ex, path);
|
|
|
|
|
|
return false;
|
|
|
}
|
|
@@ -2053,7 +2047,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error getting local Ip address information", ex);
|
|
|
+ Logger.LogError("Error getting local Ip address information", ex);
|
|
|
}
|
|
|
|
|
|
return null;
|
|
@@ -2210,19 +2204,19 @@ namespace Emby.Server.Implementations
|
|
|
var valid = string.Equals(Name, result, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
_validAddressResults.AddOrUpdate(apiUrl, valid, (k, v) => valid);
|
|
|
- Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, valid);
|
|
|
+ Logger.LogDebug("Ping test result to {0}. Success: {1}", apiUrl, valid);
|
|
|
return valid;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
catch (OperationCanceledException)
|
|
|
{
|
|
|
- Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, "Cancelled");
|
|
|
+ Logger.LogDebug("Ping test result to {0}. Success: {1}", apiUrl, "Cancelled");
|
|
|
throw;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.Debug("Ping test result to {0}. Success: {1} {2}", apiUrl, false, ex.Message);
|
|
|
+ Logger.LogDebug("Ping test result to {0}. Success: {1} {2}", apiUrl, false, ex.Message);
|
|
|
|
|
|
_validAddressResults.AddOrUpdate(apiUrl, false, (k, v) => false);
|
|
|
return false;
|
|
@@ -2261,7 +2255,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error sending server shutdown notification", ex);
|
|
|
+ Logger.LogError("Error sending server shutdown notification", ex);
|
|
|
}
|
|
|
|
|
|
ShutdownInternal();
|
|
@@ -2274,7 +2268,7 @@ namespace Emby.Server.Implementations
|
|
|
/// </summary>
|
|
|
private void RegisterServerWithAdministratorAccess()
|
|
|
{
|
|
|
- Logger.Info("Requesting administrative access to authorize http server");
|
|
|
+ Logger.LogInformation("Requesting administrative access to authorize http server");
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -2286,7 +2280,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error authorizing server", ex);
|
|
|
+ Logger.LogError("Error authorizing server", ex);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2454,7 +2448,7 @@ namespace Emby.Server.Implementations
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Console.WriteLine("Error launching url: {0}", url);
|
|
|
- Logger.ErrorException("Error launching url: {0}", ex, url);
|
|
|
+ Logger.LogError("Error launching url: {0}", ex, url);
|
|
|
|
|
|
throw;
|
|
|
}
|
|
@@ -2475,7 +2469,7 @@ namespace Emby.Server.Implementations
|
|
|
/// <param name="package">The package.</param>
|
|
|
protected void OnApplicationUpdated(PackageVersionInfo package)
|
|
|
{
|
|
|
- Logger.Info("Application has been updated to version {0}", package.versionStr);
|
|
|
+ Logger.LogInformation("Application has been updated to version {0}", package.versionStr);
|
|
|
|
|
|
EventHelper.FireEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<PackageVersionInfo>
|
|
|
{
|
|
@@ -2510,15 +2504,15 @@ namespace Emby.Server.Implementations
|
|
|
{
|
|
|
var type = GetType();
|
|
|
|
|
|
- LogManager.AddConsoleOutput();
|
|
|
- Logger.Info("Disposing " + type.Name);
|
|
|
+ //LoggerFactory.AddConsoleOutput();
|
|
|
+ Logger.LogInformation("Disposing " + type.Name);
|
|
|
|
|
|
var parts = DisposableParts.Distinct().Where(i => i.GetType() != type).ToList();
|
|
|
DisposableParts.Clear();
|
|
|
|
|
|
foreach (var part in parts)
|
|
|
{
|
|
|
- Logger.Info("Disposing " + part.GetType().Name);
|
|
|
+ Logger.LogInformation("Disposing " + part.GetType().Name);
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -2526,7 +2520,7 @@ namespace Emby.Server.Implementations
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Logger.ErrorException("Error disposing {0}", ex, part.GetType().Name);
|
|
|
+ Logger.LogError("Error disposing {0}", ex, part.GetType().Name);
|
|
|
}
|
|
|
}
|
|
|
}
|