Exemplo n.º 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;
        }
Exemplo n.º 2
0
 public MethodLoggerFactory(IServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
     _settings        = serviceProvider.GetService <MethodLoggingSettings>() ?? new MethodLoggingSettings();
 }
Exemplo n.º 3
0
 public MethodLogger(ILoggerFactory loggerFactory, Type callerType, MethodLoggingSettings settings)
 {
     _loggerFactory = loggerFactory;
     _callerType    = callerType;
     _settings      = settings;
 }