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

Add option to change the log level of the logs emitted by triggers #8329

Closed
3 tasks done
alljinx opened this issue Nov 21, 2022 · 6 comments · Fixed by #8328
Closed
3 tasks done

Add option to change the log level of the logs emitted by triggers #8329

alljinx opened this issue Nov 21, 2022 · 6 comments · Fixed by #8328
Labels
type:feature New feature or improvement of existing feature

Comments

@alljinx
Copy link
Contributor

alljinx commented Nov 21, 2022

New Feature / Enhancement Checklist

Current Limitation

Parse Server can really get very wordy when actively using triggers (beforeSave, afterSave) : this can quickly lead to oversized log files and drowned informations.

By default, theses messages are written to the log file using the 'info' channel. The only way to shut them off is to raise the log level of Parse Server to the 'warn' level.

Customization is a key characteristic of Parse Server. Developers should be able to modify the channel so they can enforce their log policy.

Feature / Enhancement Description

Add three log level options into the Parse Server config (logLevelTriggerAfterHook, logLevelTriggerSuccessBeforeHook, logLevelTriggerErrorBeforeHook) in order to fine-tune the triggers log channel according Winston's one ('info', 'debug','warn').

Example Use Case

  1. Add "logLevelUses: { triggerAfterHook: 'debug' }" to Parse Server configuration
  2. Save a Parse Object
  3. The log is not written on the 'info' channel anymore, but use the 'debug'.

Alternatives / Workarounds

The only way to shut them off is to raise the log level of Parse Server to the 'warn' level.

3rd Party References

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 21, 2022

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza
Copy link
Member

mtrezza commented Nov 21, 2022

Interesting idea; is there an alternative concept to adding N parse server options? In theory someone could ask the same for any other log entry that is written and we'd end up with many new Parse Server options.

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Nov 21, 2022
@alljinx
Copy link
Contributor Author

alljinx commented Nov 21, 2022

Yes, I guess we could use a single option and an object as value, but I guess it would be tricky to use with environment variable.

@mtrezza
Copy link
Member

mtrezza commented Nov 21, 2022

If I'm not mistaken we do have other parse options that accept stringified JSON objects, so it should work fine as env var.

@alljinx
Copy link
Contributor Author

alljinx commented Nov 22, 2022

Mmmm, you're right, thx. I'll make some corrections...

@alljinx
Copy link
Contributor Author

alljinx commented Nov 22, 2022

@mtrezza I made some corrections according to your comments. What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants