{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/863","labels_url":"https://api.github.com/repos/NLog/NLog/issues/863/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/863/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/863/events","html_url":"https://github.com/NLog/NLog/issues/863","id":101587613,"number":863,"title":"NLog removes archive files","user":{"login":"desember","id":5647839,"avatar_url":"https://avatars.githubusercontent.com/u/5647839?v=3","gravatar_id":"","url":"https://api.github.com/users/desember","html_url":"https://github.com/desember","followers_url":"https://api.github.com/users/desember/followers","following_url":"https://api.github.com/users/desember/following{/other_user}","gists_url":"https://api.github.com/users/desember/gists{/gist_id}","starred_url":"https://api.github.com/users/desember/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desember/subscriptions","organizations_url":"https://api.github.com/users/desember/orgs","repos_url":"https://api.github.com/users/desember/repos","events_url":"https://api.github.com/users/desember/events{/privacy}","received_events_url":"https://api.github.com/users/desember/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/NLog/NLog/labels/file-target","name":"file-target","color":"ffffff"},{"url":"https://api.github.com/repos/NLog/NLog/labels/up-for-grabs","name":"up-for-grabs","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-18T07:12:34Z","updated_at":"2015-12-25T19:19:59Z","closed_at":null,"body":"Hello. I'm facing strange behaviour of NLog library. At midnight it removes all files in log folder except current one. Even if I create file with date as a name maually.\r\n\r\nNLog version 4.0.1. \r\n\r\nMy configuration is:\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\r\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" autoReload=\"true\"\r\n      internalLogFile=\"C:\\***\\Nlog.txt\" internalLogLevel=\"Trace\">\r\n\r\n  <targets>\r\n\r\n    <target xsi:type=\"File\" \r\n            name=\"f\" \r\n            fileName=\"${basedir}/logs/log.log\"\r\n            archiveFileName=\"${basedir}/logs/log.{#}.log\"\r\n            archiveEvery=\"Day\"\r\n            archiveNumbering=\"Date\"\r\n            maxArchiveFiles=\"30\"\r\n            layout=\"${longdate} {${uppercase:${level}}} ${message} ${exception:format=tostring}\"/>\r\n    \r\n    <target xsi:type=\"File\"\r\n            name=\"res\"\r\n            fileName=\"${basedir}/logs/results.log\"\r\n            archiveFileName=\"${basedir}/logs/results.{#}.log\"\r\n            archiveEvery=\"Day\"\r\n            archiveNumbering=\"Date\"\r\n            maxArchiveFiles=\"30\"\r\n            layout=\"${longdate}: ${message}\"/>\r\n  </targets>\r\n\r\n  <rules>\r\n    <logger name=\"results\" minlevel=\"Debug\" writeTo=\"res\" final=\"true\" />\r\n    <logger name=\"*\" minlevel=\"Debug\" writeTo=\"f\" />\r\n  </rules>\r\n</nlog>\r\n```\r\nInternal logfile contents:\r\n```\r\n2015-08-17 23:59:14.7843 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-17 23:59:42.3019 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-17 23:59:44.7120 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-18 00:00:13.3857 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-18 00:00:16.0328 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-18 00:00:46.3106 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n2015-08-18 00:00:49.0217 Trace Opening C:\\***\\/logs\\log.log with concurrentWrite=False\r\n```"},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/167259248","html_url":"https://github.com/NLog/NLog/issues/863#issuecomment-167259248","issue_url":"https://api.github.com/repos/NLog/NLog/issues/863","id":167259248,"user":{"login":"bhaeussermann","id":7482216,"avatar_url":"https://avatars.githubusercontent.com/u/7482216?v=3","gravatar_id":"","url":"https://api.github.com/users/bhaeussermann","html_url":"https://github.com/bhaeussermann","followers_url":"https://api.github.com/users/bhaeussermann/followers","following_url":"https://api.github.com/users/bhaeussermann/following{/other_user}","gists_url":"https://api.github.com/users/bhaeussermann/gists{/gist_id}","starred_url":"https://api.github.com/users/bhaeussermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhaeussermann/subscriptions","organizations_url":"https://api.github.com/users/bhaeussermann/orgs","repos_url":"https://api.github.com/users/bhaeussermann/repos","events_url":"https://api.github.com/users/bhaeussermann/events{/privacy}","received_events_url":"https://api.github.com/users/bhaeussermann/received_events","type":"User","site_admin":false},"created_at":"2015-12-25T19:19:59Z","updated_at":"2015-12-25T19:19:59Z","body":"If you want to produce the problem in an application (VS solution), you could look into changing your system time during runtime (perhaps you could do this programmatically in your app).\r\n\r\nAs for producing the problem in a test (in `FileTargetTest.cs`), you can emulate date/time changes using `TimeSource` (there are other tests which use `TimeSource`)."}}