Exemple #1
0
        /// <summary>
        /// Add Log4Net support for Cosmos.Logging
        /// </summary>
        /// <param name="services"></param>
        /// <param name="settingAct"></param>
        /// <param name="configAct"></param>
        /// <returns></returns>
        public static ILogServiceCollection AddLog4Net(this ILogServiceCollection services, Action <Log4NetSinkOptions> settingAct = null,
                                                       Action <IConfiguration, Log4NetSinkConfiguration> configAct = null)
        {
            var settings = new Log4NetSinkOptions();

            settingAct?.Invoke(settings);
            return(services.AddLog4Net(settings, configAct));
        }
Exemple #2
0
 /// <summary>
 /// Add Log4Net support for Cosmos.Logging
 /// </summary>
 /// <param name="services"></param>
 /// <param name="sinkOptions"></param>
 /// <param name="configAct"></param>
 /// <returns></returns>
 public static ILogServiceCollection AddLog4Net(this ILogServiceCollection services, Log4NetSinkOptions sinkOptions,
                                                Action <IConfiguration, Log4NetSinkConfiguration> configAct = null)
 {
     return(services.AddLog4Net(Options.Create(sinkOptions), configAct));
 }