From 81eac3043a25492d0550582ae257b6b87695b41d Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 28 Feb 2023 14:13:17 +0100 Subject: [PATCH] Improve logging --- .../Controllers/ValidationController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs index 41a91e25..873a303e 100644 --- a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs +++ b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs @@ -67,6 +67,8 @@ namespace ZUGFeRDRESTService.Controllers }); _props = new PropertyValues(_logConfig); + _logger.Debug("Property Map initial: [{0}] entries found.", _propertyMap.Count); + if (_AllowZugferd10 == true) _propertyMap = oPropertyMap. Where(kv => kv.Value.Specification == ZUGFERD_SPEC_10 || kv.Value.Specification == ZUGFERD_SPEC_DEFAULT). @@ -79,6 +81,8 @@ namespace ZUGFeRDRESTService.Controllers Concat(_propertyMap). ToDictionary(kv => kv.Key, kv => kv.Value); + _logger.Debug("Property Map filtered: [{0}] entries found.", _propertyMap.Count); + _logger.Debug("Validation Controller initialized!"); } @@ -155,7 +159,12 @@ namespace ZUGFeRDRESTService.Controllers if (oFilteredPropertyMap.Count == 0) { + _logger.Warn("No properties found in property map for specification [{0}]", oZugferdResult.Specification); throw new ZUGFeRDExecption(ErrorType.UnsupportedFormat, "Unsupported Format"); + } + else + { + _logger.Debug("Property map contains [{0}] entries for specification [{1}]", oFilteredPropertyMap.Count, oZugferdResult.Specification); } _logger.Info("Starting structural check against the database.");