Reputation: 3129
We are using IdentityServer4 with ASP.NET Core. We want to write Identity Server's logs to an external file (i.g. log.txt
). Can we do this via the log4net library?
Upvotes: 1
Views: 2801
Reputation: 63719
From the relevant IdentityServer docs:
IdentityServer uses the standard logging facilities provided by ASP.NET Core.
So in essence, your question nearly duplicates this question about hooking up log4net in ASP.NET Core. The top answer for that question also explains how to add a rolling file appender, which is what you'd need to get what you want.
That basically answers your question as currently written. If you need more specific advise, I recommend asking a question with your current attempted code / steps to reproduce your scenario.
Upvotes: 1
Reputation: 5264
.Net Core has pretty good logging support straight out of the box.
Have a read of this: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?tabs=aspnetcore2x
Upvotes: 0