Remove Log4Net

Add NLog
This commit is contained in:
2015-10-29 00:00:49 -04:00
parent 5984cdf862
commit d2584a6cb7
11 changed files with 2550 additions and 60 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ using System.Net.Mail;
using System.Reflection;
using System.Web.Security;
using MileageTraker.Web.Models;
using log4net;
using NLog;
namespace MileageTraker.Web.Email
{
@@ -12,7 +12,7 @@ namespace MileageTraker.Web.Email
/// </summary>
public class EmailNotificationService
{
private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly string _emaialFromAddress;
private readonly string _resetPasswordSubject;
@@ -71,7 +71,7 @@ namespace MileageTraker.Web.Email
}
catch (SmtpException ex)
{
Logger.Error("Failed to send mail", ex);
Logger.Error(ex, "Failed to send mail");
}
}
}
+3 -3
View File
@@ -4,13 +4,13 @@ using System.Linq;
using System.Reflection;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Models;
using log4net;
using NLog;
namespace MileageTraker.Web.Email
{
public class ServiceReminderEmailService : IDisposable
{
private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
protected readonly DataService DataService = new DataService();
protected readonly EmailNotificationService EmailService = new EmailNotificationService();
@@ -20,7 +20,7 @@ namespace MileageTraker.Web.Email
Logger.Info("Starting vehicle service notifications");
var serviceReminders = DataService.GetUpcomingServiceReminders().ToList();
Logger.Debug("Got " + serviceReminders.Count + " service reminders.");
Logger.Info("Got " + serviceReminders.Count + " service reminders.");
SendAdminEmails(serviceReminders);