Esempio n. 1
0
        /// <summary>
        /// Add NLog support for Cosmos.Logging
        /// </summary>
        /// <param name="services"></param>
        /// <param name="settingAct"></param>
        /// <param name="configAction"></param>
        /// <returns></returns>
        public static ILogServiceCollection AddNLog(this ILogServiceCollection services, Action <NLogSinkOptions> settingAct = null,
                                                    Action <IConfiguration, NLogSinkConfiguration> configAction = null)
        {
            var settings = new NLogSinkOptions();

            settingAct?.Invoke(settings);
            return(services.AddNLog(settings, configAction));
        }
Esempio n. 2
0
 /// <summary>
 /// Add NLog support for Cosmos.Logging
 /// </summary>
 /// <param name="services"></param>
 /// <param name="options"></param>
 /// <param name="configAction"></param>
 /// <returns></returns>
 public static ILogServiceCollection AddNLog(this ILogServiceCollection services, NLogSinkOptions options,
                                             Action <IConfiguration, NLogSinkConfiguration> configAction = null)
 {
     return(services.AddNLog(Options.Create(options), configAction));
 }