From 0bb772a8153dff18f1bb18711fca7e5ebce887ac Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Wed, 6 Jan 2016 17:27:05 -0800 Subject: [PATCH] [Fixes #3755] Added logging for view compilation --- .../Compilation/RazorCompilationService.cs | 14 +++++- .../Compilation/RoslynCompilationService.cs | 13 +++++- ...RazorCompilationServiceLoggerExtensions.cs | 45 +++++++++++++++++++ .../RazorViewEngineLoggerExtensions.cs | 37 +++++++++++++++ ...oslynCompilationServiceLoggerExtensions.cs | 45 +++++++++++++++++++ .../RazorViewEngine.cs | 12 ++++- .../RazorCompilationServiceTest.cs | 10 +++-- .../RoslynCompilationServiceTest.cs | 25 +++++++---- .../RazorViewEngineTest.cs | 3 +- .../project.json | 1 + .../TestRazorCompilationService.cs | 6 ++- 11 files changed, 193 insertions(+), 18 deletions(-) create mode 100644 src/Microsoft.AspNet.Mvc.Razor/Logging/RazorCompilationServiceLoggerExtensions.cs create mode 100644 src/Microsoft.AspNet.Mvc.Razor/Logging/RazorViewEngineLoggerExtensions.cs create mode 100644 src/Microsoft.AspNet.Mvc.Razor/Logging/RoslynCompilationServiceLoggerExtensions.cs diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RazorCompilationService.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RazorCompilationService.cs index d745173257..fddc42dde2 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RazorCompilationService.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RazorCompilationService.cs @@ -3,12 +3,15 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using Microsoft.AspNet.Diagnostics; using Microsoft.AspNet.FileProviders; +using Microsoft.AspNet.Mvc.Logging; using Microsoft.AspNet.Razor; using Microsoft.AspNet.Razor.CodeGenerators; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.AspNet.Mvc.Razor.Compilation @@ -21,6 +24,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation private readonly ICompilationService _compilationService; private readonly IMvcRazorHost _razorHost; private readonly IFileProvider _fileProvider; + private readonly ILogger _logger; /// /// Instantiates a new instance of the class. @@ -31,11 +35,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation public RazorCompilationService( ICompilationService compilationService, IMvcRazorHost razorHost, - IRazorViewEngineFileProviderAccessor fileProviderAccessor) + IRazorViewEngineFileProviderAccessor fileProviderAccessor, + ILoggerFactory loggerFactory) { _compilationService = compilationService; _razorHost = razorHost; _fileProvider = fileProviderAccessor.FileProvider; + _logger = loggerFactory.CreateLogger(); } /// @@ -49,7 +55,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation GeneratorResults results; using (var inputStream = file.FileInfo.CreateReadStream()) { + _logger.RazorFileToCodeCompilationStart(file.RelativePath); + + var startTimestamp = _logger.IsEnabled(LogLevel.Debug) ? Stopwatch.GetTimestamp() : 0; + results = GenerateCode(file.RelativePath, inputStream); + + _logger.RazorFileToCodeCompilationEnd(file.RelativePath, startTimestamp); } if (!results.Success) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs index 3e011f0d23..0e6f74041e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs @@ -14,6 +14,7 @@ using System.Runtime.Loader; #endif using System.Runtime.Versioning; using Microsoft.AspNet.FileProviders; +using Microsoft.AspNet.Mvc.Logging; using Microsoft.AspNet.Mvc.Razor.Internal; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -22,6 +23,7 @@ using Microsoft.Dnx.Compilation.CSharp; using Microsoft.Extensions.PlatformAbstractions; using Microsoft.Extensions.Options; using Microsoft.AspNet.Diagnostics; +using Microsoft.Extensions.Logging; namespace Microsoft.AspNet.Mvc.Razor.Compilation { @@ -42,6 +44,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation private readonly Action _compilationCallback; private readonly CSharpParseOptions _parseOptions; private readonly CSharpCompilationOptions _compilationOptions; + private readonly ILogger _logger; #if DOTNET5_5 private readonly RazorLoadContext _razorLoadContext; @@ -60,7 +63,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation Extensions.CompilationAbstractions.ILibraryExporter libraryExporter, IMvcRazorHost host, IOptions optionsAccessor, - IRazorViewEngineFileProviderAccessor fileProviderAccessor) + IRazorViewEngineFileProviderAccessor fileProviderAccessor, + ILoggerFactory loggerFactory) { _environment = environment; _libraryExporter = libraryExporter; @@ -70,6 +74,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation _compilationCallback = optionsAccessor.Value.CompilationCallback; _parseOptions = optionsAccessor.Value.ParseOptions; _compilationOptions = optionsAccessor.Value.CompilationOptions; + _logger = loggerFactory.CreateLogger(); #if DOTNET5_5 _razorLoadContext = new RazorLoadContext(); @@ -89,6 +94,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation throw new ArgumentNullException(nameof(compilationContent)); } + _logger.GeneratedCodeToAssemblyCompilationStart(fileInfo.RelativePath); + + var startTimestamp = _logger.IsEnabled(LogLevel.Debug) ? Stopwatch.GetTimestamp() : 0; + var assemblyName = Path.GetRandomFileName(); var syntaxTree = SyntaxTreeGenerator.Generate( @@ -150,6 +159,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var type = assembly.GetExportedTypes() .First(t => t.Name.StartsWith(_classPrefix, StringComparison.Ordinal)); + _logger.GeneratedCodeToAssemblyCompilationEnd(fileInfo.RelativePath, startTimestamp); + return new CompilationResult(type); } } diff --git a/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorCompilationServiceLoggerExtensions.cs b/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorCompilationServiceLoggerExtensions.cs new file mode 100644 index 0000000000..bce4084b8d --- /dev/null +++ b/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorCompilationServiceLoggerExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNet.Mvc.Logging +{ + public static class RazorCompilationServiceLoggerExtensions + { + private static readonly double TimestampToTicks = Stopwatch.Frequency / 10000000.0; + private static readonly Action _razorFileToCodeCompilationStart; + private static readonly Action _razorFileToCodeCompilationEnd; + + static RazorCompilationServiceLoggerExtensions() + { + _razorFileToCodeCompilationStart = LoggerMessage.Define( + LogLevel.Debug, + 1, + "Code generation for the Razor file at '{FilePath}' started."); + + _razorFileToCodeCompilationEnd = LoggerMessage.Define( + LogLevel.Debug, + 2, + "Code generation for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms."); + } + + public static void RazorFileToCodeCompilationStart(this ILogger logger, string filePath) + { + _razorFileToCodeCompilationStart(logger, filePath, null); + } + + public static void RazorFileToCodeCompilationEnd(this ILogger logger, string filePath, long startTimestamp) + { + // Don't log if logging wasn't enabled at start of request as time will be wildly wrong. + if (startTimestamp != 0) + { + var currentTimestamp = Stopwatch.GetTimestamp(); + var elapsed = new TimeSpan((long)(TimestampToTicks * (currentTimestamp - startTimestamp))); + _razorFileToCodeCompilationEnd(logger, filePath, elapsed.TotalMilliseconds, null); + } + } + } +} diff --git a/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorViewEngineLoggerExtensions.cs b/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorViewEngineLoggerExtensions.cs new file mode 100644 index 0000000000..d5b79c640d --- /dev/null +++ b/src/Microsoft.AspNet.Mvc.Razor/Logging/RazorViewEngineLoggerExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNet.Mvc.Logging +{ + public static class RazorViewEngineLoggerExtensions + { + private static readonly Action _viewLookupCacheMiss; + private static readonly Action _viewLookupCacheHit; + + static RazorViewEngineLoggerExtensions() + { + _viewLookupCacheMiss = LoggerMessage.Define( + LogLevel.Debug, + 1, + "View lookup cache miss for view '{ViewName}' in controller '{ControllerName}'."); + + _viewLookupCacheHit = LoggerMessage.Define( + LogLevel.Debug, + 2, + "View lookup cache hit for view '{ViewName}' in controller '{ControllerName}'."); + } + + public static void ViewLookupCacheMiss(this ILogger logger, string viewName, string controllerName) + { + _viewLookupCacheMiss(logger, viewName, controllerName, null); + } + + public static void ViewLookupCacheHit(this ILogger logger, string viewName, string controllerName) + { + _viewLookupCacheHit(logger, viewName, controllerName, null); + } + } +} diff --git a/src/Microsoft.AspNet.Mvc.Razor/Logging/RoslynCompilationServiceLoggerExtensions.cs b/src/Microsoft.AspNet.Mvc.Razor/Logging/RoslynCompilationServiceLoggerExtensions.cs new file mode 100644 index 0000000000..f3a70fdc98 --- /dev/null +++ b/src/Microsoft.AspNet.Mvc.Razor/Logging/RoslynCompilationServiceLoggerExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNet.Mvc.Logging +{ + public static class RoslynCompilationServiceLoggerExtensions + { + private static readonly double TimestampToTicks = Stopwatch.Frequency / 10000000.0; + private static readonly Action _generatedCodeToAssemblyCompilationStart; + private static readonly Action _generatedCodeToAssemblyCompilationEnd; + + static RoslynCompilationServiceLoggerExtensions() + { + _generatedCodeToAssemblyCompilationStart = LoggerMessage.Define( + LogLevel.Debug, + 1, + "Compilation of the generated code for the Razor file at '{FilePath}' started."); + + _generatedCodeToAssemblyCompilationEnd = LoggerMessage.Define( + LogLevel.Debug, + 2, + "Compilation of the generated code for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms."); + } + + public static void GeneratedCodeToAssemblyCompilationStart(this ILogger logger, string filePath) + { + _generatedCodeToAssemblyCompilationStart(logger, filePath, null); + } + + public static void GeneratedCodeToAssemblyCompilationEnd(this ILogger logger, string filePath, long startTimestamp) + { + // Don't log if logging wasn't enabled at start of request as time will be wildly wrong. + if (startTimestamp != 0) + { + var currentTimestamp = Stopwatch.GetTimestamp(); + var elapsed = new TimeSpan((long)(TimestampToTicks * (currentTimestamp - startTimestamp))); + _generatedCodeToAssemblyCompilationEnd(logger, filePath, elapsed.TotalMilliseconds, null); + } + } + } +} diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs index fb5bb01971..426c05bc6f 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngine.cs @@ -7,9 +7,11 @@ using System.Diagnostics; using System.Globalization; using System.Linq; using System.Text.Encodings.Web; +using Microsoft.AspNet.Mvc.Logging; using Microsoft.AspNet.Mvc.Routing; using Microsoft.AspNet.Mvc.ViewEngines; using Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; @@ -35,6 +37,7 @@ namespace Microsoft.AspNet.Mvc.Razor private readonly IList _viewLocationExpanders; private readonly IRazorPageActivator _pageActivator; private readonly HtmlEncoder _htmlEncoder; + private readonly ILogger _logger; /// /// Initializes a new instance of the . @@ -43,12 +46,14 @@ namespace Microsoft.AspNet.Mvc.Razor IRazorPageFactoryProvider pageFactory, IRazorPageActivator pageActivator, HtmlEncoder htmlEncoder, - IOptions optionsAccessor) + IOptions optionsAccessor, + ILoggerFactory loggerFactory) { _pageFactory = pageFactory; _pageActivator = pageActivator; _viewLocationExpanders = optionsAccessor.Value.ViewLocationExpanders; _htmlEncoder = htmlEncoder; + _logger = loggerFactory.CreateLogger(); ViewLookupCache = new MemoryCache(new MemoryCacheOptions { CompactOnMemoryPressure = false @@ -341,8 +346,13 @@ namespace Microsoft.AspNet.Mvc.Razor ViewLocationCacheResult cacheResult; if (!ViewLookupCache.TryGetValue(cacheKey, out cacheResult)) { + _logger.ViewLookupCacheMiss(cacheKey.ViewName, cacheKey.ControllerName); cacheResult = OnCacheMiss(expanderContext, cacheKey); } + else + { + _logger.ViewLookupCacheHit(cacheKey.ViewName, cacheKey.ControllerName); + } return cacheResult; } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs index 83acc7359d..78b8acd2d3 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs @@ -9,6 +9,7 @@ using Microsoft.AspNet.Razor.Chunks; using Microsoft.AspNet.Razor.CodeGenerators; using Microsoft.AspNet.Razor.Compilation.TagHelpers; using Microsoft.AspNet.Razor.Parser.SyntaxTree; +using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Options; using Moq; using Xunit; @@ -38,7 +39,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation compiler.Setup(c => c.Compile(relativeFileInfo, It.IsAny())) .Returns(new CompilationResult(typeof(RazorCompilationServiceTest))); - var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor()); + var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor(), NullLoggerFactory.Instance); // Act razorService.Compile(relativeFileInfo); @@ -70,7 +71,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var compiler = new Mock(MockBehavior.Strict); var relativeFileInfo = new RelativeFileInfo(fileInfo.Object, @"Views\index\home.cshtml"); - var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor()); + var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor(), NullLoggerFactory.Instance); // Act var result = razorService.Compile(relativeFileInfo); @@ -111,7 +112,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation compiler.Setup(c => c.Compile(relativeFileInfo, code)) .Returns(compilationResult) .Verifiable(); - var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor()); + var razorService = new RazorCompilationService(compiler.Object, host.Object, GetFileProviderAccessor(), NullLoggerFactory.Instance); // Act var result = razorService.Compile(relativeFileInfo); @@ -136,7 +137,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var razorService = new RazorCompilationService( Mock.Of(), Mock.Of(), - GetFileProviderAccessor(fileProvider)); + GetFileProviderAccessor(fileProvider), + NullLoggerFactory.Instance); var errors = new[] { new RazorError("message-1", new SourceLocation(1, 2, 17), length: 1), diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RoslynCompilationServiceTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RoslynCompilationServiceTest.cs index 577f3320ce..dc870f2de4 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RoslynCompilationServiceTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RoslynCompilationServiceTest.cs @@ -6,6 +6,7 @@ using Microsoft.AspNet.FileProviders; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; using Microsoft.Extensions.CompilationAbstractions; +using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Options; using Microsoft.Extensions.PlatformAbstractions; using Moq; @@ -34,7 +35,8 @@ public class MyTestType {}"; libraryExporter, mvcRazorHost.Object, GetOptions(), - GetFileProviderAccessor()); + GetFileProviderAccessor(), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo( new TestFileInfo { PhysicalPath = "SomePath" }, "some-relative-path"); @@ -66,7 +68,8 @@ this should fail"; libraryExporter, mvcRazorHost, GetOptions(), - GetFileProviderAccessor(fileProvider)); + GetFileProviderAccessor(fileProvider), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo(fileInfo, "some-relative-path"); // Act @@ -95,7 +98,8 @@ this should fail"; libraryExporter, mvcRazorHost, GetOptions(), - GetFileProviderAccessor()); + GetFileProviderAccessor(), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo( new TestFileInfo { Content = fileContent }, "some-relative-path"); @@ -135,7 +139,8 @@ this should fail"; libraryExporter, mvcRazorHost, GetOptions(), - GetFileProviderAccessor(fileProvider)); + GetFileProviderAccessor(fileProvider), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo(mockFileInfo.Object, path); @@ -175,7 +180,8 @@ public class MyNonCustomDefinedClass {} libraryExporter, mvcRazorHost.Object, options, - GetFileProviderAccessor()); + GetFileProviderAccessor(), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo( new TestFileInfo { PhysicalPath = "SomePath" }, "some-relative-path"); @@ -206,7 +212,8 @@ public class NotRazorPrefixType {}"; libraryExporter, mvcRazorHost.Object, GetOptions(), - GetFileProviderAccessor()); + GetFileProviderAccessor(), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo( new TestFileInfo { PhysicalPath = "SomePath" }, @@ -238,7 +245,8 @@ public class NotRazorPrefixType {}"; CompilationServices.Default.LibraryExporter, Mock.Of(), optionsAccessor.Object, - GetFileProviderAccessor(fileProvider)); + GetFileProviderAccessor(fileProvider), + NullLoggerFactory.Instance); var assemblyName = "random-assembly-name"; @@ -330,7 +338,8 @@ public class NotRazorPrefixType {}"; libraryExporter, mvcRazorHost.Object, GetOptions(callback: c => usedCompilation = c), - GetFileProviderAccessor()); + GetFileProviderAccessor(), + NullLoggerFactory.Instance); var relativeFileInfo = new RelativeFileInfo( new TestFileInfo { PhysicalPath = "SomePath" }, diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs index 46b36ccc04..0cd9c58bae 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs @@ -11,6 +11,7 @@ using Microsoft.AspNet.Mvc.ViewEngines; using Microsoft.AspNet.Routing; using Microsoft.AspNet.Testing; using Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; using Microsoft.Extensions.WebEncoders.Testing; @@ -1806,7 +1807,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Test public TestableRazorViewEngine( IRazorPageFactoryProvider pageFactory, IOptions optionsAccessor) - : base(pageFactory, Mock.Of(), new HtmlTestEncoder(), optionsAccessor) + : base(pageFactory, Mock.Of(), new HtmlTestEncoder(), optionsAccessor, NullLoggerFactory.Instance) { } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/project.json b/test/Microsoft.AspNet.Mvc.Razor.Test/project.json index e69d5fb2e5..97a2a4b461 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/project.json +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/project.json @@ -26,6 +26,7 @@ "Microsoft.Dnx.Runtime": "1.0.0-*", "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*", + "Microsoft.Extensions.Logging.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "commands": { diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs index e92423b604..3d284b9b1e 100644 --- a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs @@ -6,6 +6,7 @@ using System.Text; using Microsoft.AspNet.Mvc.Razor; using Microsoft.AspNet.Mvc.Razor.Compilation; using Microsoft.AspNet.Razor.CodeGenerators; +using Microsoft.Extensions.Logging; namespace RazorPageExecutionInstrumentationWebSite { @@ -14,8 +15,9 @@ namespace RazorPageExecutionInstrumentationWebSite public TestRazorCompilationService( ICompilationService compilationService, IMvcRazorHost razorHost, - IRazorViewEngineFileProviderAccessor fileProviderAccessor) - : base(compilationService, razorHost, fileProviderAccessor) + IRazorViewEngineFileProviderAccessor fileProviderAccessor, + ILoggerFactory loggerFactory) + : base(compilationService, razorHost, fileProviderAccessor, loggerFactory) { }