Skip to content

Add option to change the log level of the logs emitted by cloud functions #8529

Closed
@alljinx

Description

@alljinx

New Feature / Enhancement Checklist

Current Limitation

Parse Server can really get very wordy when actively using cloud functions :

"info: Ran cloud function getMyJdm for user wSnhVbbINh with: Input: {"filters":{..."

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.
This can quickly lead to oversized log files and drowned informations.

Version 6.0.0 of Parse Server introduced a feature to customize log level for triggers in Parse Server Options :
logLevels: { triggerAfter: 'debug', triggerBeforeError: 'error', triggerBeforeSuccess: 'info' }

I would suggest to add an option to also customize log level for cloud functions :
logLevels: { triggerAfter: 'debug', triggerBeforeError: 'error', triggerBeforeSuccess: 'info', cloudFunction: 'debug' }

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 a new options to logLevels configuration in order to fine-tune the cloud function log channel according Winston's one ('silly', 'debug', 'info', 'debug','warn').

Example Use Case

  1. Add "logLevels: { cloudFunction: 'debug' }" to Parse Server configuration
  2. Run a Cloud Function
  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions