-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ASP.NET Core 3 #481
Comments
3.0:When PublishSingleFile, Nlog cannot log to file. |
@yhnbgfd Please report the unexpected behavior to Microsoft. AppDomain.BaseDirectory should not point to the temporary-directory. Some good places to write your complaint: dotnet/aspnetcore#12621 |
Hi there, i wanted to jump in here and ask if .NET Core 3 support is coming soon. I have a .NET Core 3 application and I am using NLog as shown in the .NET Core 2 sample with a database and fallback to file system if fails. I can't get any logs on the file system or in the database. I pulled the example out of my other working .NET Core 2 application. Any ideas when it might be supported or if there is a workaround for now? Thanks! |
Is this with PublishSingleFile? I try to get the .NET core 3 stuff get ready this week. I have unfortunately some troubles running .NET Core 3 myself |
Sorry I am not sure what you mean by PublishSingleFile. Can you elaborate a bit more please? |
https://dotnetcoretutorials.com/2019/06/20/publishing-a-single-exe-file-in-net-core-3-0/
|
I tried adding it, but no luck. It is writing the internal-nlog.txt file, but it won't write any of the errors on the file system, or in the database. My config file:
|
If you can attach a small example project showing the problem with NLog. Then we can try look at it. But it sounds like NLog cannot find the Nlog.config file.
What happens if you enable NLog InternalLogger through code before creating first NLog Logger object. What locations does it scan for nlog.config?
|
No problem finding config file. This is from internal log: 2019-09-30 12:20:18.1752 Info Message Template Auto Format enabled |
It is failing to log to the database when an error occurs and also not logging to a file. I am currently just running in development mode on my local machine so it should have 100% access to the stored procedure in the database. |
I'm guessing there is some issue with {config setting} were you load the Nlog.config before you have hooked NLog to NetCore appsettings.json. Think I have created an issue about improving this. Maybe the new AddNLog methods in NLog.Web.AspNetCore ver 4.9 will be helpful for you.
|
Thanks guys, turns out the problem was I forgot to Copy to Output Directory. Working fine now! |
fixed by #496, thanks @snakefoot ! |
related #480
The text was updated successfully, but these errors were encountered: