static LogRecord() { GlobalContext.Properties["InstanceName"] = Process.GetCurrentProcess().Id; var loggers = LoggerManager.GetCurrentLoggers(Assembly.GetCallingAssembly()); var loggerSystem = loggers.SingleOrDefault(f => f.Name.Equals("LoggerNameSystem", StringComparison.OrdinalIgnoreCase)); if (loggerSystem == null) { loggerSystem = loggers.FirstOrDefault(t => t.Name.Equals("LoggerNameRecordData", StringComparison.InvariantCultureIgnoreCase) == false); } logger = loggerSystem; logType = typeof(LogRecord); }
/// <summary> /// Returns all the currently defined loggers in the specified domain. /// </summary> /// <param name="domain">the domain to lookup in</param> /// <remarks> /// The root logger is <b>not</b> included in the returned array. /// </remarks> /// <returns>All the defined loggers</returns> public static IExtLog[] GetCurrentLoggers(string domain) { return(WrapLoggers(LoggerManager.GetCurrentLoggers(domain))); }
/// <summary> /// Returns all the currently defined loggers in the specified assembly's domain. /// </summary> /// <param name="assembly">the assembly to use to lookup the domain</param> /// <remarks> /// The root logger is <b>not</b> included in the returned array. /// </remarks> /// <returns>All the defined loggers</returns> public static IExtLog[] GetCurrentLoggers(Assembly assembly) { return(WrapLoggers(LoggerManager.GetCurrentLoggers(assembly))); }