public void Delete(Guid id) { Log4NetLog log4NetLog = _log4NetRepository.Get(id); _log4NetRepository.Delete(log4NetLog); _unitOfWork.Commit(); }
public virtual Log Create(SessionID sessionId) { var log = new Log4NetLog(sessionId); log.RichMessageLogging = RichMessageLogging; return(log); }
public ActionResult Details(Guid id, string name) { ViewBag.Name = name; Log4NetLog model = _log4NetService.Detail(id); return(View(model)); }
public static ILog GetLoggerByName(string name) { global::log4net.ILog log4netLogger = global::log4net.LogManager.GetLogger(name); ILog logger = new Log4NetLog(log4netLogger); return(logger); }
public static ILog GetLoggerByType(Type type) { global::log4net.ILog log4netLogger = global::log4net.LogManager.GetLogger(type); ILog logger = new Log4NetLog(log4netLogger); return(logger); }
public void GetLogger_WithNameFromType() { ILog log = LogManager.GetLogger(typeof(SampleType)); Assert.IsInstanceOf(typeof(Log4NetLog), log); Log4NetLog log4NetLog = (Log4NetLog)log; Assert.That(log4NetLog.Logger.Name, Is.EqualTo("Remotion.UnitTests.Logging.SampleType")); }
public void GetLogger_WithNameAsString() { ILog log = LogManager.GetLogger("The Name"); Assert.IsInstanceOf(typeof(Log4NetLog), log); Log4NetLog log4NetLog = (Log4NetLog)log; Assert.That(log4NetLog.Logger.Name, Is.EqualTo("The Name")); }
public static ILog GetLoggerByName(string name) { global::log4net.ILog log4netLogger = global::log4net.LogManager.GetLogger(name); // Log4NetLog is an implementation of our ILog // that accepts a lognet:ILog and delegates to it ILog logger = new Log4NetLog(log4netLogger); return(logger); }
public static void ClassInitialize(TestContext context) { ClassInitialize(); var log4NetRepository = Container.GetInstance <ILog4NetRepository>(); _log = new Log4NetLog { Date = DateTime.Now, Exception = "Custom exception", Level = "Low", Logger = "Web.Main", Message = "Custom message" }; log4NetRepository.Add(_log); Controller = new LogController(Container.GetInstance <ILog4NetService>()); }
public static void ClassInitialize(TestContext context) { ClassInitialize(); var dbContext = Container.GetInstance <EFDbContext>(); _log = dbContext.Log4NetLogs.Add(new Log4NetLog { Date = DateTime.Now, Exception = "Custom Dashboard exception", Level = "Low", Logger = "Test", Message = "Custom message" }); dbContext.SaveChanges(); }
public void SetUp() { _memoryAppender = new MemoryAppender(); var hierarchy = new Hierarchy(); ((IBasicRepositoryConfigurator)hierarchy).Configure(_memoryAppender); var logger = hierarchy.GetLogger("The Name"); var log = new Log4NetLog(logger); var logManagerStub = MockRepository.GenerateStub <ILogManager>(); logManagerStub.Stub(stub => stub.GetLogger(typeof(DiagnosticOutputRuleMergeDecorator))).Return(log); _logContextStub = MockRepository.GenerateStub <ILogContext>(); _wrappedMergerStub = MockRepository.GenerateStub <IValidationCollectorMerger>(); _validatorFormatterStub = MockRepository.GenerateStub <IValidatorFormatter>(); _diagnosticOutputRuleMergeDecorator = new DiagnosticOutputRuleMergeDecorator(_wrappedMergerStub, _validatorFormatterStub, logManagerStub); }
/// <summary> /// The debug. /// </summary> /// <param name="message"> /// The message. /// </param> public static void Debug(string message) { Log4NetLog.Debug(null, message); }
/// <summary> /// The warn. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void Warn(object sender, string message) { Log4NetLog.Warn(sender, message); }
/// <summary> /// The warn. /// </summary> /// <param name="message"> /// The message. /// </param> public static void Warn(string message) { Log4NetLog.Warn(null, message); }
/// <summary> /// The time stamp. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void TimeStamp(object sender, string message) { Log4NetLog.TimeStamp(sender, message); }
/// <summary> /// The success. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="method"> /// The method. /// </param> public static void Success(object sender, string method) { Log4NetLog.Success(sender, method); }
/// <summary> /// The success. /// </summary> /// <param name="method"> /// The method. /// </param> public static void Success(string method) { Log4NetLog.Success(null, method); }
/// <summary> /// The initialize. /// </summary> /// <param name="loggerConfigurationPath"> /// The logger configuration path. /// </param> public static void Initialize(string loggerConfigurationPath) { Log4NetLog.XmlInitialize(loggerConfigurationPath); WindowsEventLog.Initialize(loggerConfigurationPath); }
/// <summary> /// The info. /// </summary> /// <param name="message"> /// The message. /// </param> public static void Info(string message) { Log4NetLog.Info(null, message); }
///// <summary> ///// The info. ///// </summary> ///// <param name="message"> ///// The message. ///// </param> // public static void Info(string message) // { // Log4NetLog.Info(null, message); // } /// <summary> /// The info. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void Info(object sender, string message) { Log4NetLog.Info(sender, message); }
public void Test_Fatal() { Assert.That(Log4NetLog.Convert(LogLevel.Fatal), Is.EqualTo(Level.Fatal)); }
/// <summary> /// The enter. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="method"> /// The method. /// </param> public static void Enter(object sender, string method) { Log4NetLog.Enter(sender, method); }
/// <summary> /// The debug. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void Debug(object sender, string message) { Log4NetLog.Debug(sender, message); }
public void Test_InvalidLevel() { Log4NetLog.Convert((LogLevel)10); }
public Log4NetLog Detail(Guid id) { Log4NetLog model = _log4NetRepository.Get(id); return(model); }
/// <summary> /// The enter. /// </summary> /// <param name="method"> /// The method. /// </param> public static void Enter(string method) { Log4NetLog.Enter(null, method); }
/// <summary> /// The failure. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="method"> /// The method. /// </param> /// <param name="error"> /// The error. /// </param> public static void Failure(object sender, string method, Exception error) { Log4NetLog.Failure(sender, method, error); }
///// <summary> ///// The error. ///// </summary> ///// <param name="message"> ///// The message. ///// </param> // public static void Error(string message) // { // Log4NetLog.Error(null, message); // } /// <summary> /// The error. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void Error(object sender, string message) { Log4NetLog.Error(sender, message); }
/// <summary> /// The fatal. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="message"> /// The message. /// </param> public static void Fatal(object sender, string message) { Log4NetLog.Fatal(sender, message); }
public virtual Log Create(SessionID sessionId) { var log = new Log4NetLog(sessionId); log.RichMessageLogging = RichMessageLogging; return log; }
/// <summary> /// The fatal ex. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="ex"> /// The ex. /// </param> /// <param name="message"> /// The message. /// </param> public static void FatalEx(object sender, Exception ex, string message) { Log4NetLog.FatalEx(sender, ex, message); }