{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/log/issues/49","repository_url":"https://api.github.com/repos/boostorg/log","labels_url":"https://api.github.com/repos/boostorg/log/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/log/issues/49/comments","events_url":"https://api.github.com/repos/boostorg/log/issues/49/events","html_url":"https://github.com/boostorg/log/issues/49","id":287710785,"number":49,"title":"The file name rule for daily rotate log?","user":{"login":"sinall","id":1246382,"avatar_url":"https://avatars1.githubusercontent.com/u/1246382?v=4","gravatar_id":"","url":"https://api.github.com/users/sinall","html_url":"https://github.com/sinall","followers_url":"https://api.github.com/users/sinall/followers","following_url":"https://api.github.com/users/sinall/following{/other_user}","gists_url":"https://api.github.com/users/sinall/gists{/gist_id}","starred_url":"https://api.github.com/users/sinall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinall/subscriptions","organizations_url":"https://api.github.com/users/sinall/orgs","repos_url":"https://api.github.com/users/sinall/repos","events_url":"https://api.github.com/users/sinall/events{/privacy}","received_events_url":"https://api.github.com/users/sinall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-11T09:07:34Z","updated_at":"2018-02-14T05:32:33Z","closed_at":null,"author_association":"NONE","body":"I posted a [thread on stackoverflow](https://stackoverflow.com/questions/46094193/boost-log-doesnt-write-log-to-the-file-which-has-max-file-counter-or-create-new) few months ago, no one answered it. It's not very urgent since it is only log file name so I just left it.\r\n\r\nRecently I noticed that the [changelog of 1.66.0](http://www.boost.org/doc/libs/1_66_0/libs/log/doc/html/log/changelog.html) said it has been fixed.\r\n\r\nFor me I still have some issues about the file name. I can see some log file names after I upgrade boost to 1.66.0 just like it behaves in 1.65.1.\r\n\r\nHere's the code:\r\n```\r\nlogging::wsettings settings;\r\nsettings[\"Core\"][\"Filter\"] = L\"%Severity% >= debug\";\r\nsettings[\"Core\"][\"DisableLogging\"] = false;\r\nsettings[\"Sinks.File\"][\"Destination\"] = L\"TextFile\";\r\nsettings[\"Sinks.File\"][\"FileName\"] = L\"App_%Y-%m-%d.%N.log\";\r\nsettings[\"Sinks.File\"][\"Format\"] = L\"%TimeStamp% [%ThreadID%] %Severity(format=\\\"%-7s\\\")% - %Message%\";\r\nsettings[\"Sinks.File\"][\"AutoFlush\"] = true;\r\nsettings[\"Sinks.File\"][\"RotationTimePoint\"] = L\"00:00:00\";\r\nsettings[\"Sinks.File\"][\"RotationSize\"] = 10 * 1024 * 1024;\r\nsettings[\"Sinks.File\"][\"Target\"] = filePath_;\r\nsettings[\"Sinks.File\"][\"ScanForFiles\"] = L\"All\";\r\nsettings[\"Sinks.File\"][\"Append\"] = true;\r\n```\r\n\r\nHere's some log file examples:\r\n> App_2018-01-09.7.log\r\n> App_2018-01-10.8.log\r\n> App_2018-01-10.0.log\r\n> App_2018-01-11.1.log\r\n> App_2018-01-11.0.log\r\n> (Sorted by creation time ASC)\r\n\r\nMy understanding is that **the counter** and **date-time part** are **unrelated**, the counter increases whenever a new file is being created. Is my understanding correct?\r\n\r\nBut this makes the file names confusing. For example:\r\n\r\n1. Start app on 2018-01-11, then the file name is App_2018-01-11.0.log\r\n2. A new filename will be created as App_2018-01-12.1.log tomorrow\r\n3. If I restart app tomorrow, then a new filename created as App_2018-01-12.0.log\r\n\r\nIs this the **current behavior**?\r\nIf so, my **suggestion** is to reset the file counter for a new day like this:\r\n\r\n1. Start app on 2018-01-11, then the file name is App_2018-01-11.0.log\r\n2. A new filename created as App_2018-01-12.0.log tomorrow\r\n3. If I restart app tomorrow, then a new filename will be created as App_2018-01-12.0.log\r\n4. If the file becomes too large, then the file counter will be increased when creating new file name.\r\n\r\nDoes this make sense?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/boostorg/log/issues/comments/365501037","html_url":"https://github.com/boostorg/log/issues/49#issuecomment-365501037","issue_url":"https://api.github.com/repos/boostorg/log/issues/49","id":365501037,"user":{"login":"hoangtocdo90","id":22963463,"avatar_url":"https://avatars3.githubusercontent.com/u/22963463?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangtocdo90","html_url":"https://github.com/hoangtocdo90","followers_url":"https://api.github.com/users/hoangtocdo90/followers","following_url":"https://api.github.com/users/hoangtocdo90/following{/other_user}","gists_url":"https://api.github.com/users/hoangtocdo90/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangtocdo90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangtocdo90/subscriptions","organizations_url":"https://api.github.com/users/hoangtocdo90/orgs","repos_url":"https://api.github.com/users/hoangtocdo90/repos","events_url":"https://api.github.com/users/hoangtocdo90/events{/privacy}","received_events_url":"https://api.github.com/users/hoangtocdo90/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T05:32:33Z","updated_at":"2018-02-14T05:32:33Z","author_association":"NONE","body":"App_2018-01-09.7.log\r\nApp_2018-01-10.8.log\r\nApp_2018-01-10.0.log\r\nApp_2018-01-11.1.log\r\nApp_2018-01-11.0.log\r\n\r\nI think have some problem with log file number auto increment with no limit.\r\nExample App_2018-01-11.999999999999999999999.log"}}
{"actor":{"display_login":"hoangtocdo90"}}