Ejemplo n.º 1
0
        /// <summary>
        /// Use Log4Net for logging with your own appender type, initializing it as necessary.
        /// Will call 'ActivateOptions()' on the appender for you.
        /// If you don't specify a threshold, will default to Level.Debug.
        /// If you don't specify layout, uses this as a default: %d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n
        /// </summary>
        public static Configure Log4Net <TAppender>(this Configure config, Action <TAppender> initializeAppender) where TAppender : new()
        {
            var appender = new TAppender();

            initializeAppender(appender);

            return(config.Log4Net(appender));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Use Log4Net for logging with the Console Appender at the level of All.
 /// </summary>
 public static Configure Log4Net(this Configure config)
 {
     return(config.Log4Net <ConsoleAppender>(ca => ca.Threshold = Level.All));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Use Log4Net for logging with the Console Appender at the level of All.
        /// </summary>
        public static Configure Log4Net(this Configure config)
        {
            var appender = Logging.Loggers.Log4NetAdapter.Log4NetAppenderFactory.CreateConsoleAppender("All");

            return(config.Log4Net(appender));
        }