Improve logging

This commit is contained in:
Jonathan Jenne 2023-02-28 14:13:17 +01:00
parent 22c7fe8fe2
commit 81eac3043a

View File

@ -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,8 +159,13 @@ 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.");