Ejemplo n.º 1
0
        /// <inheritdoc />
        public ILog CreateLog <TComponent>(TComponent component)
        {
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }

            ILog log = new Log(_loggerFactory.CreateLogger(ComponentNameHelper.GetComponentName(component)), _healthNotifierProvider.Invoke());

            return(_sanitizingOptions.Filters.Any()
                ? new SanitizingLog(log, _sanitizingOptions)
                : log);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public ILog CreateLog <TComponent>(TComponent component, string componentNameSuffix)
        {
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }
            if (string.IsNullOrWhiteSpace(componentNameSuffix))
            {
                throw new ArgumentException("Should be not empty string", nameof(componentNameSuffix));
            }

            ILog log = new Log(_loggerFactory.CreateLogger(ComponentNameHelper.GetComponentName(component, componentNameSuffix)), _healthNotifierProvider.Invoke());

            return(_sanitizingOptions.Filters.Any()
                ? new SanitizingLog(log, _sanitizingOptions)
                : log);
        }