예제 #1
0
        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);
        }
예제 #3
0
        public ActionResult Details(Guid id, string name)
        {
            ViewBag.Name = name;
            Log4NetLog model = _log4NetService.Detail(id);

            return(View(model));
        }
예제 #4
0
    public static ILog GetLoggerByName(string name)
    {
        global::log4net.ILog log4netLogger =
            global::log4net.LogManager.GetLogger(name);
        ILog logger = new Log4NetLog(log4netLogger);

        return(logger);
    }
예제 #5
0
    public static ILog GetLoggerByType(Type type)
    {
        global::log4net.ILog log4netLogger =
            global::log4net.LogManager.GetLogger(type);
        ILog logger = new Log4NetLog(log4netLogger);

        return(logger);
    }
예제 #6
0
        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"));
        }
예제 #7
0
        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"));
        }
예제 #8
0
    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);
    }
예제 #9
0
        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>());
        }
예제 #10
0
        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();
        }
예제 #11
0
        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);
        }
예제 #12
0
 /// <summary>
 /// The debug.
 /// </summary>
 /// <param name="message">
 /// The message.
 /// </param>
 public static void Debug(string message)
 {
     Log4NetLog.Debug(null, message);
 }
예제 #13
0
 /// <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);
 }
예제 #14
0
 /// <summary>
 /// The warn.
 /// </summary>
 /// <param name="message">
 /// The message.
 /// </param>
 public static void Warn(string message)
 {
     Log4NetLog.Warn(null, message);
 }
예제 #15
0
 /// <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);
 }
예제 #16
0
 /// <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);
 }
예제 #17
0
 /// <summary>
 /// The success.
 /// </summary>
 /// <param name="method">
 /// The method.
 /// </param>
 public static void Success(string method)
 {
     Log4NetLog.Success(null, method);
 }
예제 #18
0
 /// <summary>
 /// The initialize.
 /// </summary>
 /// <param name="loggerConfigurationPath">
 /// The logger configuration path.
 /// </param>
 public static void Initialize(string loggerConfigurationPath)
 {
     Log4NetLog.XmlInitialize(loggerConfigurationPath);
     WindowsEventLog.Initialize(loggerConfigurationPath);
 }
예제 #19
0
 /// <summary>
 /// The info.
 /// </summary>
 /// <param name="message">
 /// The message.
 /// </param>
 public static void Info(string message)
 {
     Log4NetLog.Info(null, message);
 }
예제 #20
0
        ///// <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);
        }
예제 #21
0
 public void Test_Fatal()
 {
     Assert.That(Log4NetLog.Convert(LogLevel.Fatal), Is.EqualTo(Level.Fatal));
 }
예제 #22
0
 /// <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);
 }
예제 #23
0
 /// <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);
 }
예제 #24
0
 public void Test_InvalidLevel()
 {
     Log4NetLog.Convert((LogLevel)10);
 }
예제 #25
0
        public Log4NetLog Detail(Guid id)
        {
            Log4NetLog model = _log4NetRepository.Get(id);

            return(model);
        }
예제 #26
0
 /// <summary>
 /// The enter.
 /// </summary>
 /// <param name="method">
 /// The method.
 /// </param>
 public static void Enter(string method)
 {
     Log4NetLog.Enter(null, method);
 }
예제 #27
0
 /// <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);
 }
예제 #28
0
        ///// <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);
        }
예제 #29
0
 /// <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);
 }
예제 #30
0
		public virtual Log Create(SessionID sessionId)
		{
			var log = new Log4NetLog(sessionId);
			log.RichMessageLogging = RichMessageLogging;
			return log;
		}
예제 #31
0
 /// <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);
 }