{
	"issue": {
		"url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
		"repository_url": "https://api.github.com/repos/laurent22/joplin",
		"labels_url": "https://api.github.com/repos/laurent22/joplin/issues/8376/labels{/name}",
		"comments_url": "https://api.github.com/repos/laurent22/joplin/issues/8376/comments",
		"events_url": "https://api.github.com/repos/laurent22/joplin/issues/8376/events",
		"html_url": "https://github.com/laurent22/joplin/pull/8376",
		"id": 1777426271,
		"node_id": "PR_kwDOBLftOs5UD48h",
		"number": 8376,
		"title": "All: Resolves #5521: Rotating log files",
		"user": {
			"login": "hubertfilho",
			"id": 19213902,
			"node_id": "MDQ6VXNlcjE5MjEzOTAy",
			"avatar_url": "https://avatars.githubusercontent.com/u/19213902?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/hubertfilho",
			"html_url": "https://github.com/hubertfilho",
			"followers_url": "https://api.github.com/users/hubertfilho/followers",
			"following_url": "https://api.github.com/users/hubertfilho/following{/other_user}",
			"gists_url": "https://api.github.com/users/hubertfilho/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/hubertfilho/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/hubertfilho/subscriptions",
			"organizations_url": "https://api.github.com/users/hubertfilho/orgs",
			"repos_url": "https://api.github.com/users/hubertfilho/repos",
			"events_url": "https://api.github.com/users/hubertfilho/events{/privacy}",
			"received_events_url": "https://api.github.com/users/hubertfilho/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"labels": [],
		"state": "closed",
		"locked": false,
		"assignee": null,
		"assignees": [],
		"milestone": null,
		"comments": 8,
		"created_at": "2023-06-27T17:25:07Z",
		"updated_at": "2023-07-14T13:24:41Z",
		"closed_at": "2023-07-14T13:24:26Z",
		"author_association": "CONTRIBUTOR",
		"sub_issues_summary": {
			"total": 0,
			"completed": 0,
			"percent_completed": 0
		},
		"active_lock_reason": null,
		"draft": false,
		"pull_request": {
			"url": "https://api.github.com/repos/laurent22/joplin/pulls/8376",
			"html_url": "https://github.com/laurent22/joplin/pull/8376",
			"diff_url": "https://github.com/laurent22/joplin/pull/8376.diff",
			"patch_url": "https://github.com/laurent22/joplin/pull/8376.patch",
			"merged_at": "2023-07-14T13:24:26Z"
		},
		"body": "Creates another log file when the production log file reaches 5MB; And delete all log files older than 30 days.\r\n\r\n<!--\r\n\r\nPlease prefix the title with the platform you are targetting:\r\n\r\nHere are some examples of good titles:\r\n\r\n- Desktop: Resolves #123: Added new setting to change font\r\n- Mobile, Desktop: Fixes #456: Fixed config screen error\r\n- All: Resolves #777: Made synchronisation faster\r\n\r\nAnd here's an explanation of the title format:\r\n\r\n- \"Desktop\" for the Windows/macOS/Linux app (Electron app)\r\n- \"Mobile\" for the mobile app (or \"Android\" / \"iOS\" if the pull request only applies to one of the mobile platforms)\r\n- \"CLI\" for the CLI app\r\n\r\nIf it's two platforms, separate them with commas - \"Desktop, Mobile\" or if it's for all platforms, prefix with \"All\".\r\n\r\nIf it's not related to any platform (such as a translation, change to the documentation, etc.), simply don't add a platform.\r\n\r\nThen please append the issue that you've addressed or fixed. Use \"Resolves #123\" for new features or improvements and \"Fixes #123\" for bug fixes.\r\n\r\nAND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/dev/CONTRIBUTING.md\r\n\r\n-->\r\n",
		"closed_by": {
			"login": "laurent22",
			"id": 1285584,
			"node_id": "MDQ6VXNlcjEyODU1ODQ=",
			"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/laurent22",
			"html_url": "https://github.com/laurent22",
			"followers_url": "https://api.github.com/users/laurent22/followers",
			"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
			"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
			"organizations_url": "https://api.github.com/users/laurent22/orgs",
			"repos_url": "https://api.github.com/users/laurent22/repos",
			"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
			"received_events_url": "https://api.github.com/users/laurent22/received_events",
			"type": "User",
			"user_view_type": "public",
			"site_admin": false
		},
		"reactions": {
			"url": "https://api.github.com/repos/laurent22/joplin/issues/8376/reactions",
			"total_count": 0,
			"+1": 0,
			"-1": 0,
			"laugh": 0,
			"hooray": 0,
			"confused": 0,
			"heart": 0,
			"rocket": 0,
			"eyes": 0
		},
		"timeline_url": "https://api.github.com/repos/laurent22/joplin/issues/8376/timeline",
		"performed_via_github_app": null,
		"state_reason": null
	},
	"comments": [
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1609938888",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1609938888",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1609938888,
			"node_id": "IC_kwDOBLftOs5f9bfI",
			"user": {
				"login": "github-actions[bot]",
				"id": 41898282,
				"node_id": "MDM6Qm90NDE4OTgyODI=",
				"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/github-actions%5Bbot%5D",
				"html_url": "https://github.com/apps/github-actions",
				"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
				"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
				"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
				"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
				"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
				"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
				"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
				"type": "Bot",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-06-27T17:25:21Z",
			"updated_at": "2023-07-14T13:24:41Z",
			"author_association": "CONTRIBUTOR",
			"body": "****CLA Assistant Lite bot**** All contributors have signed the CLA  ✍️ ✅",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1609938888/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1609970820",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1609970820",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1609970820,
			"node_id": "IC_kwDOBLftOs5f9jSE",
			"user": {
				"login": "hubertfilho",
				"id": 19213902,
				"node_id": "MDQ6VXNlcjE5MjEzOTAy",
				"avatar_url": "https://avatars.githubusercontent.com/u/19213902?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/hubertfilho",
				"html_url": "https://github.com/hubertfilho",
				"followers_url": "https://api.github.com/users/hubertfilho/followers",
				"following_url": "https://api.github.com/users/hubertfilho/following{/other_user}",
				"gists_url": "https://api.github.com/users/hubertfilho/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/hubertfilho/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/hubertfilho/subscriptions",
				"organizations_url": "https://api.github.com/users/hubertfilho/orgs",
				"repos_url": "https://api.github.com/users/hubertfilho/repos",
				"events_url": "https://api.github.com/users/hubertfilho/events{/privacy}",
				"received_events_url": "https://api.github.com/users/hubertfilho/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-06-27T17:52:42Z",
			"updated_at": "2023-06-27T17:52:42Z",
			"author_association": "CONTRIBUTOR",
			"body": "So, the issue is working, but I believe that we need to make some improvements.\r\nThe logic I used is: every time that a new line is insert in the log file it'll call the cleanLogFile function, this function is going to verify if the log file is bigger than or equal to 5MB, if it is than it's going to rename the current log file to log-timestamp.txt. And also, in the finally part of the promise, there's another function call named deleteOlderLogFiles (it should be deleteOldLogFiles I'll fix that), well in this function I'm running through all log files and verifying if they're older than 30 days, if it is than delete it.\r\n\r\nImprovements and fixes:\r\n- I don't like the fact that I'm verifying the size and age of the log file every time that a new line is added;\r\n- When I rename the log file to log-timestamp.txt sometimes appears an error in the console, because it seems that it runs many times in a row and there isn't a log file to be renamed;\r\n\r\nI would like to have more \"control\" about what's happening with the log files. For example, set some interval to verify the size and the age of the log files, and during this verification block any new entries in the log file. Like, block -> verify the size and age -> perform some changes if it's necessary -> unblock.\r\n\r\nAnd I believe that I need to improve the type of the variables and maybe the organization of the code? What do you think about these poins?\r\n\r\nThanks!!!",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1609970820/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1610000558",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1610000558",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1610000558,
			"node_id": "IC_kwDOBLftOs5f9qiu",
			"user": {
				"login": "laurent22",
				"id": 1285584,
				"node_id": "MDQ6VXNlcjEyODU1ODQ=",
				"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/laurent22",
				"html_url": "https://github.com/laurent22",
				"followers_url": "https://api.github.com/users/laurent22/followers",
				"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
				"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
				"organizations_url": "https://api.github.com/users/laurent22/orgs",
				"repos_url": "https://api.github.com/users/laurent22/repos",
				"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
				"received_events_url": "https://api.github.com/users/laurent22/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-06-27T18:12:48Z",
			"updated_at": "2023-06-27T18:12:48Z",
			"author_association": "OWNER",
			"body": "> I would like to have more \"control\" about what's happening with the log files. For example, set some interval to verify the size and the age of the log files, and during this verification block any new entries in the log file. Like, block -> verify the size and age -> perform some changes if it's necessary -> unblock.\r\n\r\nI don't think this would be necessary. A `move` operation is atomic and quick, so it shouldn't need a lock",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1610000558/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1610006727",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1610006727",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1610006727,
			"node_id": "IC_kwDOBLftOs5f9sDH",
			"user": {
				"login": "hubertfilho",
				"id": 19213902,
				"node_id": "MDQ6VXNlcjE5MjEzOTAy",
				"avatar_url": "https://avatars.githubusercontent.com/u/19213902?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/hubertfilho",
				"html_url": "https://github.com/hubertfilho",
				"followers_url": "https://api.github.com/users/hubertfilho/followers",
				"following_url": "https://api.github.com/users/hubertfilho/following{/other_user}",
				"gists_url": "https://api.github.com/users/hubertfilho/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/hubertfilho/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/hubertfilho/subscriptions",
				"organizations_url": "https://api.github.com/users/hubertfilho/orgs",
				"repos_url": "https://api.github.com/users/hubertfilho/repos",
				"events_url": "https://api.github.com/users/hubertfilho/events{/privacy}",
				"received_events_url": "https://api.github.com/users/hubertfilho/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-06-27T18:18:11Z",
			"updated_at": "2023-06-27T18:18:11Z",
			"author_association": "CONTRIBUTOR",
			"body": "Thanks for the review, I'll do the changes...",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1610006727/reactions",
				"total_count": 1,
				"+1": 1,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1614676865",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1614676865",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1614676865,
			"node_id": "IC_kwDOBLftOs5gPgOB",
			"user": {
				"login": "laurent22",
				"id": 1285584,
				"node_id": "MDQ6VXNlcjEyODU1ODQ=",
				"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/laurent22",
				"html_url": "https://github.com/laurent22",
				"followers_url": "https://api.github.com/users/laurent22/followers",
				"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
				"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
				"organizations_url": "https://api.github.com/users/laurent22/orgs",
				"repos_url": "https://api.github.com/users/laurent22/repos",
				"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
				"received_events_url": "https://api.github.com/users/laurent22/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-06-30T13:47:18Z",
			"updated_at": "2023-06-30T13:47:18Z",
			"author_association": "OWNER",
			"body": "@hubertfilho, please see the comment above https://github.com/laurent22/joplin/pull/8376#issuecomment-1609938888 You need to sign the CLA",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1614676865/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1618256318",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1618256318",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1618256318,
			"node_id": "IC_kwDOBLftOs5gdKG-",
			"user": {
				"login": "hubertfilho",
				"id": 19213902,
				"node_id": "MDQ6VXNlcjE5MjEzOTAy",
				"avatar_url": "https://avatars.githubusercontent.com/u/19213902?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/hubertfilho",
				"html_url": "https://github.com/hubertfilho",
				"followers_url": "https://api.github.com/users/hubertfilho/followers",
				"following_url": "https://api.github.com/users/hubertfilho/following{/other_user}",
				"gists_url": "https://api.github.com/users/hubertfilho/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/hubertfilho/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/hubertfilho/subscriptions",
				"organizations_url": "https://api.github.com/users/hubertfilho/orgs",
				"repos_url": "https://api.github.com/users/hubertfilho/repos",
				"events_url": "https://api.github.com/users/hubertfilho/events{/privacy}",
				"received_events_url": "https://api.github.com/users/hubertfilho/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-07-03T13:24:27Z",
			"updated_at": "2023-07-03T13:24:27Z",
			"author_association": "CONTRIBUTOR",
			"body": "I have read the CLA Document and I hereby sign the CLA",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1618256318/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1618256981",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1618256981",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1618256981,
			"node_id": "IC_kwDOBLftOs5gdKRV",
			"user": {
				"login": "hubertfilho",
				"id": 19213902,
				"node_id": "MDQ6VXNlcjE5MjEzOTAy",
				"avatar_url": "https://avatars.githubusercontent.com/u/19213902?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/hubertfilho",
				"html_url": "https://github.com/hubertfilho",
				"followers_url": "https://api.github.com/users/hubertfilho/followers",
				"following_url": "https://api.github.com/users/hubertfilho/following{/other_user}",
				"gists_url": "https://api.github.com/users/hubertfilho/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/hubertfilho/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/hubertfilho/subscriptions",
				"organizations_url": "https://api.github.com/users/hubertfilho/orgs",
				"repos_url": "https://api.github.com/users/hubertfilho/repos",
				"events_url": "https://api.github.com/users/hubertfilho/events{/privacy}",
				"received_events_url": "https://api.github.com/users/hubertfilho/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-07-03T13:24:51Z",
			"updated_at": "2023-07-03T13:24:51Z",
			"author_association": "CONTRIBUTOR",
			"body": "recheck",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1618256981/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		},
		{
			"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1635862402",
			"html_url": "https://github.com/laurent22/joplin/pull/8376#issuecomment-1635862402",
			"issue_url": "https://api.github.com/repos/laurent22/joplin/issues/8376",
			"id": 1635862402,
			"node_id": "IC_kwDOBLftOs5hgUeC",
			"user": {
				"login": "laurent22",
				"id": 1285584,
				"node_id": "MDQ6VXNlcjEyODU1ODQ=",
				"avatar_url": "https://avatars.githubusercontent.com/u/1285584?v=4",
				"gravatar_id": "",
				"url": "https://api.github.com/users/laurent22",
				"html_url": "https://github.com/laurent22",
				"followers_url": "https://api.github.com/users/laurent22/followers",
				"following_url": "https://api.github.com/users/laurent22/following{/other_user}",
				"gists_url": "https://api.github.com/users/laurent22/gists{/gist_id}",
				"starred_url": "https://api.github.com/users/laurent22/starred{/owner}{/repo}",
				"subscriptions_url": "https://api.github.com/users/laurent22/subscriptions",
				"organizations_url": "https://api.github.com/users/laurent22/orgs",
				"repos_url": "https://api.github.com/users/laurent22/repos",
				"events_url": "https://api.github.com/users/laurent22/events{/privacy}",
				"received_events_url": "https://api.github.com/users/laurent22/received_events",
				"type": "User",
				"user_view_type": "public",
				"site_admin": false
			},
			"created_at": "2023-07-14T13:24:18Z",
			"updated_at": "2023-07-14T13:24:18Z",
			"author_association": "OWNER",
			"body": "Looks good now, let's merge. Thanks Hubert!",
			"reactions": {
				"url": "https://api.github.com/repos/laurent22/joplin/issues/comments/1635862402/reactions",
				"total_count": 0,
				"+1": 0,
				"-1": 0,
				"laugh": 0,
				"hooray": 0,
				"confused": 0,
				"heart": 0,
				"rocket": 0,
				"eyes": 0
			},
			"performed_via_github_app": null
		}
	]
}