Skip to content

Commit

Permalink
Removed ${aspnet-request-posted-body} because NLog 5.0 only supports …
Browse files Browse the repository at this point in the history
…threadsafe layoutrenderers
  • Loading branch information
snakefoot committed Feb 3, 2022
1 parent 82867e7 commit 473b356
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 312 deletions.
8 changes: 0 additions & 8 deletions examples/ASP.NET Core 3/ASP.NET Core 3 - VS2019/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseRouting();
app.UseAuthorization();

// needed for ${aspnet-request-posted-body} with an API Controller. Must be before app.UseEndpoints
app.Use(async (context, next) => {
context.Request.EnableBuffering();
await next();
});

app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});


}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- File Target for own log messages with extra web details using some ASP.NET core renderers -->
<target xsi:type="File" name="ownFile-web" fileName="c:\temp\nlog-AspNetCore5-own-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}|${callsite}| body: ${aspnet-request-posted-body}" />
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}|${callsite}" />

<!--Console Target for hosting lifetime messages to improve Docker / Visual Studio startup detection -->
<target xsi:type="Console" name="lifetimeConsole" layout="${MicrosoftConsoleLayout}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- File Target for own log messages with extra web details using some ASP.NET core renderers -->
<target xsi:type="File" name="ownFile-web" fileName="c:\temp\nlog-AspNetCore6-own-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}|${callsite}| body: ${aspnet-request-posted-body}" />
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}|${callsite}" />

<!--Console Target for hosting lifetime messages to improve Docker / Visual Studio startup detection -->
<target xsi:type="Console" name="lifetimeConsole" layout="${MicrosoftConsoleLayout}" />
Expand Down
183 changes: 0 additions & 183 deletions src/Shared/LayoutRenderers/AspNetRequestPostedBody.cs

This file was deleted.

119 changes: 0 additions & 119 deletions tests/Shared/LayoutRenderers/AspNetRequestPostedBodyTests.cs

This file was deleted.

0 comments on commit 473b356

Please sign in to comment.