예제 #1
0
        public MethodLogScope(ILogger logger, MethodLoggingSettings settings, MethodBase methodInfo)
        {
            _settings = settings;
            if (_settings.LogLevel > LogLevel.Error)
            {
                return;
            }

            _currentExecutionContext = Thread.CurrentThread.ExecutionContext;
            AppDomain.CurrentDomain.FirstChanceException += FirstChanceExceptionHandler;
            _logger     = logger;
            _methodInfo = methodInfo;
        }
예제 #2
0
 public MethodLoggerFactory(IServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
     _settings        = serviceProvider.GetService <MethodLoggingSettings>() ?? new MethodLoggingSettings();
 }
예제 #3
0
 public MethodLogger(ILoggerFactory loggerFactory, Type callerType, MethodLoggingSettings settings)
 {
     _loggerFactory = loggerFactory;
     _callerType    = callerType;
     _settings      = settings;
 }