Exemple #1
0
        /// <summary>
        /// Add exception integration for Cosmos Logging
        /// </summary>
        /// <param name="service"></param>
        /// <param name="exceptionOptionAct"></param>
        /// <param name="configAction"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static ILogServiceCollection AddExceptionsIntegration(
            this ILogServiceCollection service,
            Action <ExceptionOptions> exceptionOptionAct = null,
            Action <IConfiguration, ExceptionConfiguration> configAction = null)
        {
            if (service is null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            var settings = ExceptionOptions.Create(exceptionOptionAct);

            service.UseExceptionExtensionsCore(settings.ToMsOptions(), (conf, sink, _) => configAction?.Invoke(conf, sink));

            return(service);
        }