diff --git a/NzbDrone.Common/ExceptioneerTarget.cs b/NzbDrone.Common/ExceptioneerTarget.cs
index 600f4c93d..51883b907 100644
--- a/NzbDrone.Common/ExceptioneerTarget.cs
+++ b/NzbDrone.Common/ExceptioneerTarget.cs
@@ -14,7 +14,7 @@ namespace NzbDrone.Common
if (logEvent == null || logEvent.Exception == null) return;
if (Debugger.IsAttached || Process.GetCurrentProcess().ProcessName.Contains("JetBrains")) return;
- Logger.Trace("Sending Exception to Exceptioneer. {0}", Process.GetCurrentProcess().ProcessName);
+ Logger.Trace("Sending Exception to Exceptioneer. Process Name: {0}", Process.GetCurrentProcess().ProcessName);
logEvent.Exception.Data.Add("Message", logEvent.Message);
diff --git a/NzbDrone.Update/Program.cs b/NzbDrone.Update/Program.cs
index ed3cf0f34..bddb8221e 100644
--- a/NzbDrone.Update/Program.cs
+++ b/NzbDrone.Update/Program.cs
@@ -2,6 +2,8 @@
using System.IO;
using System.Linq;
using NLog;
+using NLog.Config;
+using NLog.Targets;
using NzbDrone.Common;
using NzbDrone.Update.Providers;
@@ -26,10 +28,7 @@ namespace NzbDrone.Update
{
Console.WriteLine("Starting NzbDrone Update Client");
- LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
- LogConfiguration.RegisterUdpLogger();
- LogConfiguration.RegisterExceptioneer();
- LogConfiguration.Reload();
+ InitLoggers();
logger.Info("Initializing update application");
@@ -48,6 +47,26 @@ namespace NzbDrone.Update
}
}
+ private static void InitLoggers()
+ {
+ LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
+ LogConfiguration.RegisterUdpLogger();
+ LogConfiguration.RegisterExceptioneer();
+
+ var fileTarget = new FileTarget();
+ fileTarget.AutoFlush = true;
+ fileTarget.ConcurrentWrites = false;
+ fileTarget.DeleteOldFileOnStartup = true;
+ fileTarget.FileName = "upgrade.log";
+ fileTarget.KeepFileOpen =false;
+
+ fileTarget.Layout = "${logger}: ${message} ${exception}";
+ LogManager.Configuration.AddTarget(fileTarget.GetType().Name, fileTarget);
+ LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
+
+ LogConfiguration.Reload();
+ }
+
public void Start(string[] args)
{
VerfityArguments(args);
diff --git a/NzbDrone.Web/Controllers/UpdateController.cs b/NzbDrone.Web/Controllers/UpdateController.cs
new file mode 100644
index 000000000..bb0b39722
--- /dev/null
+++ b/NzbDrone.Web/Controllers/UpdateController.cs
@@ -0,0 +1,32 @@
+using System.Linq;
+using System.Web.Mvc;
+using NzbDrone.Core.Providers;
+using NzbDrone.Core.Providers.Jobs;
+using NzbDrone.Web.Models;
+
+namespace NzbDrone.Web.Controllers
+{
+ public class UpdateController : Controller
+ {
+ private readonly UpdateProvider _updateProvider;
+ private readonly JobProvider _jobProvider;
+
+ public UpdateController(UpdateProvider updateProvider, JobProvider jobProvider)
+ {
+ _updateProvider = updateProvider;
+ _jobProvider = jobProvider;
+ }
+
+ public ActionResult Index()
+ {
+ return View(_updateProvider.GetAvilableUpdate());
+ }
+
+ public ActionResult StartUpdate()
+ {
+ _jobProvider.QueueJob(typeof(AppUpdateJob), 0, 0);
+
+ return Json(new NotificationResult() { Title = "Update will begin shortly", NotificationType = NotificationType.Info, Text = "NzbDrone will restart automatically."});
+ }
+ }
+}
diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj
index ce39c0ccb..29415eb68 100644
--- a/NzbDrone.Web/NzbDrone.Web.csproj
+++ b/NzbDrone.Web/NzbDrone.Web.csproj
@@ -50,6 +50,7 @@
..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
True
+
False
..\packages\MiniProfiler.1.9\lib\net40\MvcMiniProfiler.dll
@@ -463,6 +464,7 @@
+
Global.asax
@@ -939,7 +941,7 @@
-
+