private static void SetRepDefaultConfig() { var repository = LogManager.CreateRepository("default"); // log4net.Config.XmlConfigurator.Configure(repository); log4net.Config.BasicConfigurator.Configure(repository); repository = LogManager.GetRepository("default"); hierarchy = (Hierarchy)repository; // hierarchy.Root.AddAppender(rol_appender); hierarchy.Root.Level = log4net.Core.Level.All; var rol_appender = LogMaster.GetRollingAppender(); hierarchy.Root.AddAppender(rol_appender); SetedDefaultConfig = true; }
private static void SetUdpLogging(bool state = true, int?localport = null, int?remoteport = null, string remote_address = null) { var repository = LogManager.GetRepository("default"); var hierarchy = (Hierarchy)repository; var udp_appender = LogMaster.GetUDPAppender(localport, remoteport, remote_address); if (hierarchy.Root.Appenders.Contains(udp_appender))// not correct udp_appender { if (!state) { hierarchy.Root.RemoveAppender(udp_appender); } return; } hierarchy.Root.AddAppender(udp_appender); }