public AccountController(IEmailComposer emailComposer, IEmailer emailer, IDiObjectMapper mapper, IApplicationLogService applicationLogService) { _emailComposer = emailComposer; _emailer = emailer; _mapper = mapper; _applicationLogService = applicationLogService; }
public void EstablishNotAuthenticatedContext() { agencyContext = new AgencyContext(); calendar = new Mock<ICalendarService>(); calendar.Expect(c => c.CurrentDateTime).Returns(new DateTime(2009, 1, 29)); context = new Mock<ICanAddToContext>(); context.Expect(c => c.AddToContext(It.IsAny<ApplicationLog>())).Verifiable(); applicationLogService = new ApplicationLogService(agencyContext, calendar.Object, context.Object); }
private ApplicationLogService(ILog log, string userName) { _log = log; if (!string.IsNullOrEmpty(userName)) { log4net.MDC.Set("auth", userName); } _theInstance = this; }
private ApplicationLogService(Type callingType, string userName, int stackDepth) { //StackTrace stackTrace = new StackTrace(stackDepth + 1); //MethodBase methodBase = stackTrace.GetFrame(0).GetMethod(); //Type callingType = methodBase.DeclaringType; _log = log4net.LogManager.GetLogger(callingType); if (!string.IsNullOrEmpty(userName)) { log4net.MDC.Set("auth", userName); } _theInstance = this; }
public static void EnableLogging(Type callingType) { IApplicationLogService log = ApplicationLogService.InitializeLogger(log4net.LogManager.GetLogger(callingType), null); }