Comments (4)
Hi @georgechr ,
Thank you very much for your feedback.
Can you provide some additional information in order to reproduce the error on my side?
Thank you. Regards,
Angel
from microsoft.extensions.logging.log4net.aspnetcore.
I've tried to reproduce the problem but I think that I didn't reproduced it correctly.
Steps
- Create a Web API .NET Core project by default.
- Configure the extensions on Startup.cs file properly.
- Throw an exception from the API/Values default controller action.
The result was that the exception (and the stack trace) was printed on the debug window.
Lab> fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0]
Lab> An unhandled exception has occurred while executing the request
Lab> System.Exception: Doh!
Lab> at Lab.Controllers.ValuesController.Get() in C:\angel\code\github\huorswords\Microsoft.Extensions.Logging.Log4Net.AspNetCore\src\Lab\Controllers\ValuesController.cs:line 16
Lab> at lambda_method(Closure , Object , Object[] )
Lab> at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__22.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Lab> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Lab> at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
Lab> --- End of stack trace from previous location where exception was thrown ---
Lab> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Lab> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Lab> at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()
I can't see what you where or what the problem is, so @georgechr please, provide me some information (or an example project) with your expected result and steps to reproduce it.
Thanks.
Angel
from microsoft.extensions.logging.log4net.aspnetcore.
from microsoft.extensions.logging.log4net.aspnetcore.
Hello @georgechr,
Thank you very much by your report.
I just added a change on the develop branch in order to use the content of the exception as part of the final message that will be logged.
And, for extensibility questions, I've added also the possibility of configure your own formatter when an exception is included as part of the logged state.
Let me know if these changes will fix your issue.
Thanks
from microsoft.extensions.logging.log4net.aspnetcore.
Related Issues (20)
- Removing old log files HOT 1
- Missing Release Notes HOT 2
- Use it in a windows service console application HOT 1
- How to add SMTPAppender HOT 1
- Logging to different Log4Net loggers with dependency injection HOT 1
- Question about name HOT 3
- Thank you for the contribution.
- Does this work with .NET or .NET Core applications? HOT 1
- .net 7 HOT 2
- Need Example Logging Facade Use Outside of ASP HOT 2
- Enable internal debugging HOT 1
- Add .NET 8 support HOT 2
- Missing copyright notice in license
- Upgrading to net8.0 throws exception on startup. HOT 1
- Initialize without a config file HOT 1
- microsoft.extensions.logging.log4net.aspnetcore is missing NuGet package README file
- .NET8.0 XML Exception Problem HOT 4
- EventId Not Showing in Logs
- Logging latest scope value
- How do I configure log4net from in memory configuration xml element? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft.extensions.logging.log4net.aspnetcore.