public void TestLogSuccessConfig() { ILogFactory factory = new Log4NetLogFactory("log4netTest.config"); ILog log = factory.GetLog("unitTest"); log.ErrorFormat("发生了错误:{0}", "我就开个玩笑"); }
public void TestLog() { ILogFactory factory = new Log4NetLogFactory(); ILog log = factory.GetLog("unitTest"); log.ErrorFormat("发生了错误:{0}", "我就开个玩笑"); }
private Logger() { Log4NetLogFactory facto = new Log4NetLogFactory(); // Get the default logger logger = facto.GetLog("HL7Fuse"); }
public TaskManager() { allTasks = new List <TaskInfo>(); lockObject = new object(); Logger = new Log4NetLogFactory().GetLog(this.GetHashCode().ToString()); AppEvents.Instance.StopAllTasksEvent += StopAll; }
public AppContext Setup() { // Setup logging var lf = new Log4NetLogFactory(); lf.AddConsoleAppender().AddFileAppender().EndConfig(); LogManager.SetLogFactory(lf); _log = LogManager.GetLogger(typeof(AppContext)); _log.Debug("Starting setup of app context"); // Setup GUI Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Register system stuff RegisterSystem(); // Add stuff to the container RegisterWdc(); // Register all of the forms RegisterWinForms(); // Validate _container.Verify(); return(this); }
private static void registerLoggerIn(IContainer container, IPKSimConfiguration configuration) { var log4NetLogFactory = new Log4NetLogFactory(); log4NetLogFactory.Configure(new FileInfo(configuration.LogConfigurationFile)); log4NetLogFactory.UpdateLogFileLocation(configuration.AllUsersFolderPath); container.RegisterImplementationOf((ILogFactory)log4NetLogFactory); }
public static void SetupLogging() { if (LogManager.IsReady()) { return; } Log4NetLogFactory lf = new Log4NetLogFactory(); lf.AddConsoleAppender().SetLogLevel("debug").EndConfig(); LogManager.SetLogFactory(lf); }
private Logger() { Log4NetLogFactory LogFactory = new Log4NetLogFactory(); Infolog = LogFactory.GetLog("Info"); Debuglog = LogFactory.GetLog("Debug"); Errorlog = LogFactory.GetLog("Error"); Fatallog = LogFactory.GetLog("Fatal"); Warnlog = LogFactory.GetLog("Warn"); Chatlog = LogFactory.GetLog("Chat"); Maillog = LogFactory.GetLog("Mail"); }