diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-20 00:46:29 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-20 00:46:29 -0400 |
| commit | ce20066bc0e2c7ba1634200cdee6ac339d4dfb60 (patch) | |
| tree | 3a9a9f84031bf07d67eefb1a52251d701b279b0c /MediaBrowser.Common.Implementations/BaseApplicationHost.cs | |
| parent | 880fa216744340db2843c4f773664426ff8bfe36 (diff) | |
update translations
Diffstat (limited to 'MediaBrowser.Common.Implementations/BaseApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/BaseApplicationHost.cs | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs index 178b840a8..850309465 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs @@ -211,6 +211,8 @@ namespace MediaBrowser.Common.Implementations JsonSerializer = CreateJsonSerializer(); Logger = LogManager.GetLogger("App"); + OnLoggerLoaded(true); + LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false); IsFirstRun = !ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted; progress.Report(2); @@ -219,16 +221,11 @@ namespace MediaBrowser.Common.Implementations ? LogSeverity.Debug : LogSeverity.Info; - // Put the app config in the log for troubleshooting purposes - Logger.LogMultiline("Application Configuration:", LogSeverity.Info, new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration))); - progress.Report(3); DiscoverTypes(); progress.Report(14); - Logger.Info("Version {0} initializing", ApplicationVersion); - SetHttpLimit(); progress.Report(15); @@ -245,6 +242,47 @@ namespace MediaBrowser.Common.Implementations progress.Report(100); } + protected virtual void OnLoggerLoaded(bool isFirstLoad) + { + Logger.Info("Application version: {0}", ApplicationVersion); + + if (!isFirstLoad) + { + LogEnvironmentInfo(Logger, ApplicationPaths); + } + + // Put the app config in the log for troubleshooting purposes + Logger.LogMultiline("Application configuration:", LogSeverity.Info, new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration))); + + if (Plugins != null) + { + var pluginBuilder = new StringBuilder(); + + foreach (var plugin in Plugins) + { + pluginBuilder.AppendLine(string.Format("{0} {1}", plugin.Name, plugin.Version)); + } + + Logger.LogMultiline("Plugins:", LogSeverity.Info, pluginBuilder); + } + } + + public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths) + { + logger.Info("Command line: {0}", string.Join(" ", Environment.GetCommandLineArgs())); + + logger.Info("Server: {0}", Environment.MachineName); + logger.Info("Operating system: {0}", Environment.OSVersion.ToString()); + logger.Info("Processor count: {0}", Environment.ProcessorCount); + logger.Info("64-Bit OS: {0}", Environment.Is64BitOperatingSystem); + logger.Info("64-Bit Process: {0}", Environment.Is64BitProcess); + logger.Info("Program data path: {0}", appPaths.ProgramDataPath); + + logger.Info("Application Path: {0}", appPaths.ApplicationPath); + + logger.Info("*** When reporting issues please include the entire log file. ***".ToUpper()); + } + protected virtual IJsonSerializer CreateJsonSerializer() { return new JsonSerializer(); |
