Skip to content

Commit dfae19e

Browse files
committed
Merge branch 'release/2.2' -> 'master'
2 parents 52f3f79 + e22a7d1 commit dfae19e

File tree

13 files changed

+58
-35
lines changed

13 files changed

+58
-35
lines changed

eng/PatchConfig.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ Later on, this will be checked using this condition:
4343
<PackagesInPatch>
4444
Microsoft.AspNetCore.AspNetCoreModule;
4545
Microsoft.AspNetCore.AspNetCoreModuleV2;
46+
Microsoft.AspNetCore.Identity.UI;
4647
java:signalr;
48+
Microsoft.AspNetCore.Mvc.Core;
49+
Microsoft.AspNetCore.Mvc.RazorPages;
50+
Microsoft.AspNetCore.AzureAppServicesIntegration;
51+
Microsoft.AspNetCore.AzureAppServices.HostingStartup;
52+
Microsoft.AspNetCore.AzureAppServices.SiteExtension;
4753
</PackagesInPatch>
4854
</PropertyGroup>
4955

src/Mvc/Mvc.Core/src/MvcCoreLoggerExtensions.cs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal static class MvcCoreLoggerExtensions
3131
private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;
3232

3333
private static readonly Action<ILogger, string, string, Exception> _actionExecuting;
34+
private static readonly Action<ILogger, string, MethodInfo, string, string, Exception> _controllerActionExecuting;
3435
private static readonly Action<ILogger, string, double, Exception> _actionExecuted;
3536

3637
private static readonly Action<ILogger, string, string, Exception> _pageExecuting;
@@ -41,7 +42,7 @@ internal static class MvcCoreLoggerExtensions
4142
private static readonly Action<ILogger, string, Exception> _contentResultExecuting;
4243

4344
private static readonly Action<ILogger, string, ModelValidationState, Exception> _actionMethodExecuting;
44-
private static readonly Action<ILogger, string, string[], ModelValidationState, Exception> _actionMethodExecutingWithArguments;
45+
private static readonly Action<ILogger, string, string[], Exception> _actionMethodExecutingWithArguments;
4546
private static readonly Action<ILogger, string, string, double, Exception> _actionMethodExecuted;
4647

4748
private static readonly Action<ILogger, string, string[], Exception> _logFilterExecutionPlan;
@@ -159,6 +160,11 @@ static MvcCoreLoggerExtensions()
159160
new EventId(1, "ActionExecuting"),
160161
"Route matched with {RouteData}. Executing action {ActionName}");
161162

163+
_controllerActionExecuting = LoggerMessage.Define<string, MethodInfo, string, string>(
164+
LogLevel.Information,
165+
new EventId(3, "ControllerActionExecuting"),
166+
"Route matched with {RouteData}. Executing controller action with signature {MethodInfo} on controller {Controller} ({AssemblyName}).");
167+
162168
_actionExecuted = LoggerMessage.Define<string, double>(
163169
LogLevel.Information,
164170
new EventId(2, "ActionExecuted"),
@@ -189,10 +195,10 @@ static MvcCoreLoggerExtensions()
189195
new EventId(1, "ActionMethodExecuting"),
190196
"Executing action method {ActionName} - Validation state: {ValidationState}");
191197

192-
_actionMethodExecutingWithArguments = LoggerMessage.Define<string, string[], ModelValidationState>(
193-
LogLevel.Information,
198+
_actionMethodExecutingWithArguments = LoggerMessage.Define<string, string[]>(
199+
LogLevel.Trace,
194200
new EventId(1, "ActionMethodExecutingWithArguments"),
195-
"Executing action method {ActionName} with arguments ({Arguments}) - Validation state: {ValidationState}");
201+
"Executing action method {ActionName} with arguments ({Arguments})");
196202

197203
_actionMethodExecuted = LoggerMessage.Define<string, string, double>(
198204
LogLevel.Information,
@@ -713,13 +719,29 @@ public static void ExecutingAction(this ILogger logger, ActionDescriptor action)
713719
stringBuilder.Append($"{routeKeys[i]} = \"{routeValues[i]}\", ");
714720
}
715721
}
722+
716723
if (action.RouteValues.TryGetValue("page", out var page) && page != null)
717724
{
718725
_pageExecuting(logger, stringBuilder.ToString(), action.DisplayName, null);
719726
}
720727
else
721728
{
722-
_actionExecuting(logger, stringBuilder.ToString(), action.DisplayName, null);
729+
if (action is ControllerActionDescriptor controllerActionDescriptor)
730+
{
731+
var controllerType = controllerActionDescriptor.ControllerTypeInfo.AsType();
732+
var controllerName = TypeNameHelper.GetTypeDisplayName(controllerType);
733+
_controllerActionExecuting(
734+
logger,
735+
stringBuilder.ToString(),
736+
controllerActionDescriptor.MethodInfo,
737+
controllerName,
738+
controllerType.Assembly.GetName().Name,
739+
null);
740+
}
741+
else
742+
{
743+
_actionExecuting(logger, stringBuilder.ToString(), action.DisplayName, null);
744+
}
723745
}
724746
}
725747
}
@@ -858,21 +880,17 @@ public static void ActionMethodExecuting(this ILogger logger, ControllerContext
858880
var actionName = context.ActionDescriptor.DisplayName;
859881

860882
var validationState = context.ModelState.ValidationState;
883+
_actionMethodExecuting(logger, actionName, validationState, null);
861884

862-
string[] convertedArguments;
863-
if (arguments == null)
864-
{
865-
_actionMethodExecuting(logger, actionName, validationState, null);
866-
}
867-
else
885+
if (arguments != null && logger.IsEnabled(LogLevel.Trace))
868886
{
869-
convertedArguments = new string[arguments.Length];
887+
var convertedArguments = new string[arguments.Length];
870888
for (var i = 0; i < arguments.Length; i++)
871889
{
872890
convertedArguments[i] = Convert.ToString(arguments[i]);
873891
}
874892

875-
_actionMethodExecutingWithArguments(logger, actionName, convertedArguments, validationState, null);
893+
_actionMethodExecutingWithArguments(logger, actionName, convertedArguments, null);
876894
}
877895
}
878896
}

src/Mvc/Mvc.RazorPages/src/PageLoggerExtensions.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ internal static class PageLoggerExtensions
1313
{
1414
public const string PageFilter = "Page Filter";
1515

16-
private static readonly Action<ILogger, string, string[], ModelValidationState, Exception> _handlerMethodExecuting;
16+
private static readonly Action<ILogger, string, ModelValidationState, Exception> _handlerMethodExecuting;
1717
private static readonly Action<ILogger, ModelValidationState, Exception> _implicitHandlerMethodExecuting;
18+
private static readonly Action<ILogger, string, string[], Exception> _handlerMethodExecutingWithArguments;
1819
private static readonly Action<ILogger, string, string, Exception> _handlerMethodExecuted;
1920
private static readonly Action<ILogger, string, Exception> _implicitHandlerMethodExecuted;
2021
private static readonly Action<ILogger, object, Exception> _pageFilterShortCircuit;
@@ -26,10 +27,15 @@ static PageLoggerExtensions()
2627
{
2728
// These numbers start at 101 intentionally to avoid conflict with the IDs used by ResourceInvoker.
2829

29-
_handlerMethodExecuting = LoggerMessage.Define<string, string[], ModelValidationState>(
30+
_handlerMethodExecuting = LoggerMessage.Define<string, ModelValidationState>(
3031
LogLevel.Information,
3132
new EventId(101, "ExecutingHandlerMethod"),
32-
"Executing handler method {HandlerName} with arguments ({Arguments}) - ModelState is {ValidationState}");
33+
"Executing handler method {HandlerName} - ModelState is {ValidationState}");
34+
35+
_handlerMethodExecutingWithArguments = LoggerMessage.Define<string, string[]>(
36+
LogLevel.Trace,
37+
new EventId(103, "HandlerMethodExecutingWithArguments"),
38+
"Executing handler method {HandlerName} with arguments ({Arguments})");
3339

3440
_handlerMethodExecuted = LoggerMessage.Define<string, string>(
3541
LogLevel.Information,
@@ -73,23 +79,19 @@ public static void ExecutingHandlerMethod(this ILogger logger, PageContext conte
7379
{
7480
var handlerName = handler.MethodInfo.DeclaringType.FullName + "." + handler.MethodInfo.Name;
7581

76-
string[] convertedArguments;
77-
if (arguments == null)
78-
{
79-
convertedArguments = null;
80-
}
81-
else
82+
var validationState = context.ModelState.ValidationState;
83+
_handlerMethodExecuting(logger, handlerName, validationState, null);
84+
85+
if (arguments != null && logger.IsEnabled(LogLevel.Trace))
8286
{
83-
convertedArguments = new string[arguments.Length];
87+
var convertedArguments = new string[arguments.Length];
8488
for (var i = 0; i < arguments.Length; i++)
8589
{
8690
convertedArguments[i] = Convert.ToString(arguments[i]);
8791
}
88-
}
8992

90-
var validationState = context.ModelState.ValidationState;
91-
92-
_handlerMethodExecuting(logger, handlerName, convertedArguments, validationState, null);
93+
_handlerMethodExecutingWithArguments(logger, handlerName, convertedArguments, null);
94+
}
9395
}
9496
}
9597

src/Mvc/benchmarkapps/BasicViews/BasicViews.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
33
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
44
<TargetFrameworks Condition="'$(BenchmarksTargetFramework)' != ''">$(BenchmarksTargetFramework)</TargetFrameworks>

src/Mvc/shared/Mvc.Views.TestCommon/Microsoft.AspNetCore.Mvc.Views.TestCommon.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>

src/Mvc/test/WebSites/ApplicationModelWebSite/ApplicationModelWebSite.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
@@ -7,7 +7,6 @@
77

88
<ItemGroup>
99
<Reference Include="Microsoft.AspNetCore.Mvc" />
10-
1110
<Reference Include="Microsoft.AspNetCore.Server.IISIntegration" />
1211
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
1312
<Reference Include="Microsoft.AspNetCore.StaticFiles" />

src/Mvc/test/WebSites/RazorBuildWebSite/RazorBuildWebSite.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
2020
<Reference Include="Microsoft.AspNetCore.StaticFiles" />
2121
<Reference Include="Microsoft.AspNetCore.Diagnostics" />
22-
2322
</ItemGroup>
2423

2524
</Project>

src/Mvc/test/WebSites/RazorPagesWebSite/RazorPagesWebSite.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>

src/Mvc/test/WebSites/TagHelpersWebSite/TagHelpersWebSite.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
@@ -8,7 +8,6 @@
88

99
<ItemGroup>
1010
<Reference Include="Microsoft.AspNetCore.Mvc" />
11-
1211
<Reference Include="Microsoft.AspNetCore.Server.IISIntegration" />
1312
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
1413
<Reference Include="Microsoft.AspNetCore.StaticFiles" />

src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.10.txt

Whitespace-only changes.

src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.4.txt

Whitespace-only changes.

src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.10.txt

Whitespace-only changes.

src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.4.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)