Skip to content
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

There is a bug if maxLogFiles suffer with d #6426

Closed
beiguancyc opened this issue Feb 20, 2020 · 6 comments · Fixed by #9215
Closed

There is a bug if maxLogFiles suffer with d #6426

beiguancyc opened this issue Feb 20, 2020 · 6 comments · Fixed by #9215
Labels
bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) state:released-alpha Released as alpha version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@beiguancyc
Copy link

Hello guys,

I test my app with config :
--appId xxx --masterKey xxx --databaseURI mongodb://xxx --maxLogFiles 20
It's right.

but,if I write this like :
--appId xxx --masterKey xxx --databaseURI mongodb://xxx --maxLogFiles 20d
It's wrong.

undefined:1
20d
^
SyntaxError: Unexpected token d in JSON at position 2

I find the code in follow file.

./lib/Options/parsers.js

function objectParser(opt) {
if (typeof opt == 'object') {
return opt;
}
return JSON.parse(opt);
}

I hope can fix it,Thank you.

@dplewis
Copy link
Member

dplewis commented Feb 20, 2020

Nice catch!

The issue is here it shouldn't use objectParser but one for number and strings.

@dplewis dplewis added the type:bug Impaired feature or lacking behavior that is likely assumed label Feb 20, 2020
@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 8, 2020
@mtrezza mtrezza removed the stale label Nov 8, 2020
@mtrezza mtrezza added the bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) label Jul 7, 2024
@vivekjoshi556
Copy link
Contributor

Hello @dplewis & @mtrezza,

According to documentation for maxLogFiles:

This can be a number of files or number of days. If using days, add 'd' as the suffix.

I don't think 'd' matters here anyway because both imply the same thing.
For each day a new file is created, so how many log files should be created at max and how many days of files to keep is essentially the same thing, (so maybe we can update the documentation to remove instructions about this 'd')

@dplewis
Copy link
Member

dplewis commented Jul 7, 2024

For each day a new file is created

Up to 2 files can be created each day, one for info and error.

@vivekjoshi556
Copy link
Contributor

vivekjoshi556 commented Jul 9, 2024

Hi @dplewis,

Yes, I understand that 2 files are created. But my point was do we really need 'd' at all.

When you give:

  • maxLogFiles = 2: It means that the maximum number of log files to keep is 2 (for each type info and err, i.e. a total of 4 files). Since, the new file is created on next day at the end we will have files with a rotation of 2 days.
  • maxLogFiles = '2d': If we are using this, we are trying to do the same thing we are trying to delete files older than 2 days and keep logs for last 2 days (including today of-course).

Am I wrong about this?

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-alpha.5

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) state:released-alpha Released as alpha version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
5 participants