public Log4NetLogFactory()
        {
            // Set some defaults
            var hierarchy = GetLogHierarchy();

            // Set configured to false, it hasn't been finished yet
            hierarchy.Configured = false;

            // Add the simple appender
            SimpleAppender simpleAppender = new SimpleAppender();

            hierarchy.Root.AddAppender(simpleAppender);

#if DEBUG
            SetLogLevel("debug", silent: true);
#else
            SetLogLevel("info", silent: true);
#endif
        }
        public void Setup(string logLevel)
        {
            //Hierarchy hierarchy = (Hierarchy)log4net.LogManager.GetRepository(Assembly.GetExecutingAssembly());
            Hierarchy hierarchy = GetLogHierarchy();

            PatternLayout patternLayout = new PatternLayout();

            patternLayout.ConversionPattern = LOG_LAYOUT_LONG;
            patternLayout.ActivateOptions();

            // Log File appender
            RollingFileAppender roller = new RollingFileAppender();

            roller.AppendToFile       = true;
            roller.File               = @"Logs\EventLog.txt";
            roller.Layout             = patternLayout;
            roller.MaxSizeRollBackups = 5;
            roller.MaximumFileSize    = "1GB";
            roller.RollingStyle       = RollingFileAppender.RollingMode.Size;
            roller.StaticLogFileName  = true;
            roller.ActivateOptions();
            hierarchy.Root.AddAppender(roller);

            // Console appender
            PatternLayout consolePatternLayout = new PatternLayout(LOG_LAYOUT_CONSOLE);

            consolePatternLayout.ActivateOptions();
            ConsoleAppender console = new ConsoleAppender();

            console.Layout = consolePatternLayout;
            console.ActivateOptions();
            hierarchy.Root.AddAppender(console);

            // Our custom event-drive appender
            SimpleAppender simpleAppender = new SimpleAppender();

            hierarchy.Root.AddAppender(simpleAppender);

            // Set the logging level
            hierarchy.Root.Level = ParseLevel(logLevel);
            hierarchy.Configured = true;
        }