PostSharp aspnet core execution time #1
-
Hi I've been struggling with this for a couple of days now and i'm hoping somebody can help. I have an aspnet core app and I've configured logging and included the execution time for my methods. I've also included AspNetCoreLogging, so I can see the start and end of my requests and I'm using Serilog to store all my logs in a database table. My problem is that the logs for the AspNetCoreLogging package don't contain the execution time on success. My other logs do correctly show the execution time, it just the AspNetCoreLogging logs that do not show it. What I want to be able to see is something like this... I've been doing a lot of googling trying to find an answer on this but I've come up empty. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should enable this manually using <?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration">
<Logging xmlns="clr-namespace:PostSharp.Patterns.Diagnostics;assembly:PostSharp.Patterns.Diagnostics">
<Profiles>
<LoggingProfile Name="Default" IncludeSourceLineInfo="True" IncludeExecutionTime="True" IncludeAwaitedTask="True">
<DefaultOptions>
<LoggingOptions IncludeParameterType="True" IncludeThisValue="True"/>
</DefaultOptions>
</LoggingProfile>
</Profiles>
</Logging>
</Project> Note that the documentation page configures a profile named |
Beta Was this translation helpful? Give feedback.
You should enable this manually using
postsharp.config
. See this documentation page and look for the following code:Note that the documentation page configu…