diff --git a/MediaBrowser.Common.Implementations/Configuration/BaseConfigurationManager.cs b/MediaBrowser.Common.Implementations/Configuration/BaseConfigurationManager.cs index 7f9299ff2..fa15023ca 100644 --- a/MediaBrowser.Common.Implementations/Configuration/BaseConfigurationManager.cs +++ b/MediaBrowser.Common.Implementations/Configuration/BaseConfigurationManager.cs @@ -123,6 +123,7 @@ namespace MediaBrowser.Common.Implementations.Configuration /// public void SaveConfiguration() { + Logger.Info("Saving system configuration"); var path = CommonApplicationPaths.SystemConfigurationFilePath; Directory.CreateDirectory(Path.GetDirectoryName(path)); diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index 5c70179a8..2b7cc10aa 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -296,6 +296,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager private async Task GetCachedResponse(string responseCachePath, TimeSpan cacheLength, string url) { + _logger.Info("Checking for cache file {0}", responseCachePath); + try { if (_fileSystem.GetLastWriteTimeUtc(responseCachePath).Add(cacheLength) > DateTime.UtcNow) diff --git a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs index 5dbbe5373..dfd4b02d0 100644 --- a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs @@ -68,7 +68,7 @@ namespace MediaBrowser.Common.Implementations.Serialization private Stream OpenFile(string path) { - _logger.Debug("Deserializing file {0}", path); + _logger.Info("Deserializing file {0}", path); return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 131072); } diff --git a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs index 290524921..5996f02d3 100644 --- a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs @@ -80,6 +80,7 @@ namespace MediaBrowser.Common.Implementations.Serialization /// The file. public void SerializeToFile(object obj, string file) { + _logger.Info("Serializing to file {0}", file); using (var stream = new FileStream(file, FileMode.Create)) { SerializeToStream(obj, stream); @@ -94,7 +95,7 @@ namespace MediaBrowser.Common.Implementations.Serialization /// System.Object. public object DeserializeFromFile(Type type, string file) { - _logger.Debug("Deserializing file {0}", file); + _logger.Info("Deserializing file {0}", file); using (var stream = _fileSystem.OpenRead(file)) { return DeserializeFromStream(type, stream); diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index 5c82ccb0e..8c7646209 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -193,6 +193,7 @@ namespace MediaBrowser.Common.Implementations.Updates /// Task{List{PackageInfo}}. public async Task> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken) { + _logger.Info("Opening {0}", PackageCachePath); try { using (var stream = _fileSystem.OpenRead(PackageCachePath)) diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index 0c627d751..ec544dd70 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -12,6 +12,7 @@ using System.IO; using System.Linq; using System.Reflection; using CommonIO; +using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.Localization { @@ -35,6 +36,7 @@ namespace MediaBrowser.Server.Implementations.Localization private readonly IFileSystem _fileSystem; private readonly IJsonSerializer _jsonSerializer; + private readonly ILogger _logger; /// /// Initializes a new instance of the class. @@ -42,11 +44,12 @@ namespace MediaBrowser.Server.Implementations.Localization /// The configuration manager. /// The file system. /// The json serializer. - public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer) + public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger) { _configurationManager = configurationManager; _fileSystem = fileSystem; _jsonSerializer = jsonSerializer; + _logger = logger; ExtractAll(); } @@ -75,7 +78,10 @@ namespace MediaBrowser.Server.Implementations.Localization { using (var stream = type.Assembly.GetManifestResourceStream(resource)) { - using (var fs = _fileSystem.GetFileStream(Path.Combine(localizationPath, filename), FileMode.Create, FileAccess.Write, FileShare.Read)) + var target = Path.Combine(localizationPath, filename); + _logger.Info("Extracting ratings to {0}", target); + + using (var fs = _fileSystem.GetFileStream(target, FileMode.Create, FileAccess.Write, FileShare.Read)) { stream.CopyTo(fs); } diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 5d017880c..2a22fc537 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -3862,7 +3862,7 @@ namespace MediaBrowser.Server.Implementations.Persistence ? (CommandBehavior.SequentialAccess | CommandBehavior.SingleResult) : CommandBehavior.SequentialAccess; - Logger.Debug("GetItemValues: " + cmd.CommandText); + //Logger.Debug("GetItemValues: " + cmd.CommandText); using (var reader = cmd.ExecuteReader(commandBehavior)) { diff --git a/MediaBrowser.Server.Mono/Security/PKCS12.cs b/MediaBrowser.Server.Mono/Security/PKCS12.cs index f6c32421e..b5da09c63 100644 --- a/MediaBrowser.Server.Mono/Security/PKCS12.cs +++ b/MediaBrowser.Server.Mono/Security/PKCS12.cs @@ -1929,34 +1929,5 @@ namespace MediaBrowser.Server.Mono.Security { password_max_length = value; } } - - // static methods - - static private byte[] LoadFile (string filename) - { - byte[] data = null; - using (FileStream fs = File.OpenRead (filename)) { - data = new byte [fs.Length]; - fs.Read (data, 0, data.Length); - fs.Close (); - } - return data; - } - - static public PKCS12 LoadFromFile (string filename) - { - if (filename == null) - throw new ArgumentNullException ("filename"); - - return new PKCS12 (LoadFile (filename)); - } - - static public PKCS12 LoadFromFile (string filename, string password) - { - if (filename == null) - throw new ArgumentNullException ("filename"); - - return new PKCS12 (LoadFile (filename), password); - } } } diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 1e5c54d93..755dec6da 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -418,7 +418,7 @@ namespace MediaBrowser.Server.Startup.Common RegisterSingleInstance(ServerConfigurationManager); - LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer); + LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager")); RegisterSingleInstance(LocalizationManager); RegisterSingleInstance(() => new BdInfoExaminer()); @@ -489,7 +489,7 @@ namespace MediaBrowser.Server.Startup.Common var encryptionManager = new EncryptionManager(); RegisterSingleInstance(encryptionManager); - ConnectManager = new ConnectManager(LogManager.GetLogger("Connect"), ApplicationPaths, JsonSerializer, encryptionManager, HttpClient, this, ServerConfigurationManager, UserManager, ProviderManager, SecurityManager, FileSystemManager); + ConnectManager = new ConnectManager(LogManager.GetLogger("ConnectManager"), ApplicationPaths, JsonSerializer, encryptionManager, HttpClient, this, ServerConfigurationManager, UserManager, ProviderManager, SecurityManager, FileSystemManager); RegisterSingleInstance(ConnectManager); DeviceManager = new DeviceManager(new DeviceRepository(ApplicationPaths, JsonSerializer, LogManager.GetLogger("DeviceManager"), FileSystemManager), UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager);