Example #1
0
        public static LoggerFunc CreateLoggerInstance()
        {
            if (log2 != null)
            {
                return(log2);
            }

            lock (logKey)
            {
                if (log2 == null)
                {
                    log4net.Repository.ILoggerRepository repository = log4net.LogManager.CreateRepository(CommonQueueName);
                    string log4NetPath = AppDomain.CurrentDomain.BaseDirectory + "log4net.config";
                    log2        = new LoggerFunc();
                    log2.logCfg = new FileInfo(log4NetPath);
                    log4net.Config.XmlConfigurator.Configure(repository, log2.logCfg);
                    log4net.Config.BasicConfigurator.Configure(repository);
                    log2.errorLogger = log4net.LogManager.GetLogger(repository.Name, "MyError");
                }
            }

            return(log2);
        }
Example #2
0
        public static void SaveLog(string s)
        {
            LoggerFunc c = LoggerFactory.CreateLoggerInstance();

            c.SaveErrorLogTxT(s);
        }