Exemplo n.º 1
0
        public static void Main()
        {
            var simpleLayout    = new XmlLayout();
            var consoleAppender = new ConsoleAppender(simpleLayout);

            consoleAppender.ReportLevel = ReportLevel.Error;

            var logger = new Logger(consoleAppender);

            logger.Info("3/31/2015 5:33:07 PM", "Everything seems fine");
            logger.Warning("3/31/2015 5:33:07 PM", "Warning: ping is too high - disconnect imminent");
            logger.Error("3/31/2015 5:33:07 PM", "Error parsing request");
            logger.Critical("3/31/2015 5:33:07 PM", "No connection string found in App.config");
            logger.Fatal("3/31/2015 5:33:07 PM", "mscorlib.dll does not respond");
        }
Exemplo n.º 2
0
        static void Main()
        {
            //ILayout layout = new SimpleLayout();
            ILayout layout = new BracesLayout();

            // file is located in bin/Debug
            //IAppender appender = new FileAppender(layout, "SOLID-log.txt");
            //IAppender appender = new FileAppender("SOLID-log.txt");

            IAppender appender = new ConsoleAppender(layout);
            //IAppender appender = new ConsoleAppender();
            ILogger logger = new Logger(appender);

            logger.Info(string.Format("User {0} successfully registered.", "Gosho"));
            logger.Warn("Warning - missing files.");
            logger.Critical(string.Format("I am {0} and i messed it up a little bit.", "Gosho"));
            logger.Fatal(string.Format("I am {0} and I literally f*cked it up!", "Gosho"));
        }
Exemplo n.º 3
0
        static void Main()
        {
            //ILayout layout = new SimpleLayout();
            ILayout layout = new BracesLayout();

            // file is located in bin/Debug
            //IAppender appender = new FileAppender(layout, "SOLID-log.txt");
            //IAppender appender = new FileAppender("SOLID-log.txt");

            IAppender appender = new ConsoleAppender(layout);
            //IAppender appender = new ConsoleAppender();
            ILogger logger = new Logger(appender);

            logger.Info(string.Format("User {0} successfully registered.", "Gosho"));
            logger.Warn("Warning - missing files.");
            logger.Critical(string.Format("I am {0} and i messed it up a little bit.", "Gosho"));
            logger.Fatal(string.Format("I am {0} and I literally f*cked it up!", "Gosho"));
        }