aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations/BaseApplicationHost.cs')
-rw-r--r--MediaBrowser.Common.Implementations/BaseApplicationHost.cs48
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();