Fixes logging for PublishedRouter

This commit is contained in:
Shannon
2021-02-17 12:45:59 +11:00
parent 2477951493
commit 16836951b4

View File

@@ -417,8 +417,8 @@ namespace Umbraco.Web.Routing
// some finders may implement caching
using (_profilingLogger.DebugDuration<PublishedRouter>(
$"{tracePrefix}Begin finders",
$"{tracePrefix}End finders, {(request.HasPublishedContent ? "a document was found" : "no document was found")}"))
$"{tracePrefix}Executing finders...",
$"{tracePrefix}Completed executing finders"))
{
//iterate but return on first one that finds it
var found = _contentFinders.Any(finder =>
@@ -426,6 +426,16 @@ namespace Umbraco.Web.Routing
_logger.Debug<PublishedRouter>("Finder {ContentFinderType}", finder.GetType().FullName);
return finder.TryFindContent(request);
});
_profilingLogger.Debug<PublishedRouter>(
"Found? {Found} Content: {PublishedContentId}, Template: {TemplateAlias}, Domain: {Domain}, Culture: {Culture}, Is404: {Is404}, StatusCode: {StatusCode}",
found,
request.HasPublishedContent ? request.PublishedContent.Id : "NULL",
request.HasTemplate ? request.TemplateAlias : "NULL",
request.HasDomain ? request.Domain.ToString() : "NULL",
request.Culture?.Name ?? "NULL",
request.Is404,
request.ResponseStatusCode);
}
// indicate that the published content (if any) we have at the moment is the