Esempio n. 1
0
        static public ILoggingBuilder AddChannelLogger(
            this ILoggingBuilder builder,
            Action <ChannelLoggerConfiguration> configure)
        {
            builder.AddChannelLogger();
            builder.Services.Configure(configure);

            return(builder);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds the file logger provider, aliased as 'File', in the available services as singleton and binds the file logger options class to the 'File' section of the appsettings.json file.
        /// </summary>
        public static ILoggingBuilder AddChannelLogger(this ILoggingBuilder builder, Action <ChannelLoggerOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            builder.AddChannelLogger();
            builder.Services.Configure(configure);

            return(builder);
        }