{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1748","repository_url":"https://api.github.com/repos/NLog/NLog","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1748/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1748/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1748/events","html_url":"https://github.com/NLog/NLog/issues/1748","id":187766458,"number":1748,"title":"Unexpected Archiving Behavior when ArchiveEvery=\"Day\" and MaxArchiveFiles=\"1\"","user":{"login":"meadjm","id":19559054,"avatar_url":"https://avatars.githubusercontent.com/u/19559054?v=3","gravatar_id":"","url":"https://api.github.com/users/meadjm","html_url":"https://github.com/meadjm","followers_url":"https://api.github.com/users/meadjm/followers","following_url":"https://api.github.com/users/meadjm/following{/other_user}","gists_url":"https://api.github.com/users/meadjm/gists{/gist_id}","starred_url":"https://api.github.com/users/meadjm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meadjm/subscriptions","organizations_url":"https://api.github.com/users/meadjm/orgs","repos_url":"https://api.github.com/users/meadjm/repos","events_url":"https://api.github.com/users/meadjm/events{/privacy}","received_events_url":"https://api.github.com/users/meadjm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-07T16:57:11Z","updated_at":"2016-11-07T18:38:46Z","closed_at":null,"body":"NLog Unexpected Rolling\\Archiving Behavior when ArchiveEvery=\"Day\" and MaxArchiveFiles=\"1\"\r\n\r\nWith our current NLog configuration, I would expect to have a log `<dayNumber>_AppName.log` (i.e. 07_AppName.log) for every day in the month. When the day log from the previous month exists, I would expect it to roll to the archive 00_AppName.0.log, truncate the existing day log for the new day (at or about 12:00:01 AM) and start logging again. The problem we are intermittently seeing is that the previous days log rolls to the archive file and its day log is either truncated or deleted. The current days day log is truncated as expected (but not archived). This effectively is giving us 2 logs for the entire month (if the files are deleted). The current day and previous day as the archive file or we get empty day logs if the files are truncated.  We have several different applications using this configuration. The logging seems to work as expected for several days and then starts exhibiting this odd behavior. Another application we have consistently starts with this behavior immediately.\r\n\r\nI recently updated the application from NLog 4.3.4 to 4.3.10 as it looks an archiving issue was resolved \r\n\r\nNote: We really do not care about the archive file, but this was a work around for issue #1479. The archiving configuration forces the previous months log to be truncated. We are waiting for the fix that supports MaxArchiveFiles=0 to mean no archive files.\r\n\r\nAny ideas what could be causing this? \r\n\r\n**Type** Bug\r\n\r\n**NLog version**: 4.3.10\r\n\r\n**Platform**: .Net 4.0  \r\n\r\n**Current NLog config**:\r\n\r\n```xml\r\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" autoReload=\"false\">\r\n    <variable name=\"logDirectory\" value=\"D:\\Logs\"/>\r\n    <variable name=\"logLayout\" value=\"${longdate} | ${threadid:padding=-2} | ${level:padding=-5} ${callsite} | ${message} | ${onexception:EXCEPTION OCCURRED\\:${Exception:format=type,message,method,stacktrace:maxInnerExceptionLevel=5}}\"/>\r\n    <targets>\r\n        <default-target-parameters xsi:type=\"File\" keepFileOpen=\"true\" OpenFileCacheTimeout=\"5\" ArchiveEvery=\"Day\" ArchiveNumbering=\"Rolling\" MaxArchiveFiles=\"1\" />\r\n        <target name=\"AppLog\" xsi:type=\"File\" fileName=\"${logDirectory}\\${date:format=dd}_AppName.log\" layout =\"${logLayout}\" />\r\n    </targets>\r\n    <rules>\r\n        <logger name=\"*AppLog\" minlevel=\"trace\" writeTo=\"AppLog\" />\r\n    </rules>\r\n</nlog>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/258922566","html_url":"https://github.com/NLog/NLog/issues/1748#issuecomment-258922566","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1748","id":258922566,"user":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T18:38:46Z","updated_at":"2016-11-07T18:38:46Z","body":"> I recently updated the application from NLog 4.3.4 to 4.3.10 as it looks an archiving issue was resolved\r\n\r\nSo there isn't an issue? I don't get it fully :("}}
{"actor":{"display_login":"304NotModified"}}