public Log4NetLoggingService( IApplicationConfiguration configurationRepository , IAddLoggingContextProvider contextService , IWcfAppenderService wcfAppenderService , bool isMock = false ) { _isMock = isMock; _configurationRepository = configurationRepository ?? throw new ArgumentNullException(nameof(configurationRepository)); _contextService = contextService ?? throw new ArgumentNullException(nameof(contextService)); _wcfAppenderService = wcfAppenderService; try { _log4NetConfigFileName = _configurationRepository.GetLocationOfLog4NetConfigFile(); } catch (Exception) { throw new ApplicationException("Log4NetSettingsFile key missing from web/app configuration."); } if (string.IsNullOrEmpty(_log4NetConfigFileName)) { throw new ApplicationException("Log4NetSettingsFile key missing from web/app configuration."); } try { // Override setting, logs everything to database (via windows communication foundation) _logEverythingViaWcf = _configurationRepository.GetLogEverythingViaWCF(); } catch (Exception) { // fallback, default is false _logEverythingViaWcf = "false"; } try { // Override setting, disables all logging to database (via windows communication foundation) _dontLogAnythingViaWcf = _configurationRepository.GetDontLogAnythingViaWCF(); } catch (Exception) { // fallback, default is false _dontLogAnythingViaWcf = "false"; } try { // Override setting, disables all logging to database (via windows communication foundation) _logEverythingToFile = _configurationRepository.GetLogEverythingToFile(); } catch (Exception) { // fallback, default is true _logEverythingToFile = "true"; } SetupLogger(); }