-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
dotnet core nlog running on Linux logs only one entry #1633
Comments
I think there is something wrong with the timezone, as the file should be named |
This is the listing of the archive folder:
The date command shows British Summer Time (the machine is set to Europe/London):
|
So the machine is in UTC+1 (summer time) right? |
Yes. |
I can test in a different timezone if that would help. |
Well I don't think it's a timezone as the difference in less then expected. Do you know if the dates in the archive are correct? It should take the date of the last write |
I have just done an experiment:
The output from date and the cat command are as follows:
There is a delay between starting the site and the code logging the message which account for the small difference in time. Should the logged time be local time? |
This is an issue with archiving. The issue is also in 4.3, see #1645 (comment) |
Hi, I am using .NET Core 1.1.0 and NLog.Extensions.Logging 1.0.0-rtm-alpha5.
My logfiles
|
We're aware of this issue, but i'm unable to fix this right now. .NET Core is pretty unstable on my machine, Visual Studio is really slow and working on this is taking for the simplest things a lot of time. I have no time to (waste) my time on these issues. Tried today VS2017, but also a lot of crashes, errors and other issues. Spend hours on reinstalling, but even on AppVeyor (the build server), it's unstable. Help on this will be appreciated. I will wait for netstandard 2.0 and a stable VS2017 until I will work again on .NET Core stuff. |
It seems file-creation time doesn't work on Linux when using Ext2 and Ext3 (Works on ext4 + btfrs) http://www.mail-archive.com/rsync@lists.samba.org/msg21509.html A workaround on MONO / Linux could be to use UnixFileSystemInfo.LastStatusChangeTimeUtc (ctime). This is not perfect and not the same as file birth time. This is updated for various system calls, any that modify the inode, rather than the data it contains. A different workaround would be to check the result of GetFileCreationTimeUtc(), and if less than Year 1980, then we regard the result as not trusted. Instead we make fallback to a single call to GetFileLastWriteTimeUtc(), and caches the creation time until the appender is closed. |
Thanks @snakefoot! Another way is to administer the creation dates in another file, eg. .nlogcreationdates |
@304NotModified Have created #1931, that also fixes the UnixMultiProcessFileAppender. Since one cannot always trust File.GetCreationTimeUtc on non-Windows. |
Should be fixed in the next beta, beta 6 We have to merge the master again into CoreCLR, which give probably a lot of merge conflicts |
merging now |
OS:Linux for Windows 10,Ubuntu 14.04-x64 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) @304NotModified ,I want to know if it has to fixed? |
Unfortunately not yet. As you can see here, a lot has been changed since NLog 4.4 and need to find some time to fix it. See #1944 for the process. |
more test results are here. NLog/NLog.Extensions.Logging#63 Will work on this tonight. |
This should be fixed in beta06. https://www.nuget.org/packages/NLog/5.0.0-beta06 Would be great if you could confirm! |
Type (choose one): Bug
NLog version: v4.4.0-beta15
Platform: .NET Core
Current NLog config (xml or C#, if relevant)
I am running an aspnet core site on Linux using Kestrel. I have set up nlog to log to csv files. All is well in my Windows development environment, but when I run it on Linux I only get one entry in the log file. I turned on nlog tracing and found the following error in the output:
I have concurrent writes true and keepFileOpen false which seems necessary as kestrel forks multiple dotnet processes on Linux.
I have found no work around and there are no earlier versions which support dotnet core.
I don't yet know if I could write a unit test for this, the setup required to reproduce the environment would be complex.
I have attached an NLog log file.
nlog.txt
The text was updated successfully, but these errors were encountered: