Exemplo n.º 1
0
        public static void init()
        {
            var consolelogformatter = new ConsoleLogFormatter();
            logger.setUseParentHandlers(false);
            var consolehandler = new ConsoleHandler();
            consolehandler.setFormatter(consolelogformatter);
            logger.addHandler(consolehandler);

            try
            {
                var filehandler = new FileHandler("server.log", true);
                filehandler.setFormatter(consolelogformatter);
                logger.addHandler(filehandler);
            }
            catch (Exception exception)
            {
                logger.log(Level.WARNING, "Failed to log to server.log", exception);
            }
        }
Exemplo n.º 2
0
        public static void init()
        {
            var consolelogformatter = new ConsoleLogFormatter();

            logger.setUseParentHandlers(false);
            var consolehandler = new ConsoleHandler();

            consolehandler.setFormatter(consolelogformatter);
            logger.addHandler(consolehandler);


            try
            {
                var filehandler = new FileHandler("server.log", true);
                filehandler.setFormatter(consolelogformatter);
                logger.addHandler(filehandler);
            }
            catch (Exception exception)
            {
                logger.log(Level.WARNING, "Failed to log to server.log", exception);
            }
        }