Skip to content

Make Logging More Useful #2501

Closed
Closed
@acinader

Description

@acinader

With regard to logging of hooks and functions:

  1. The amount of data that is being logged with each hook invocation can be enormous in our application.
  2. Structured data is being stuck into the message as a string and then also being included in metadata

I suggest that in FunctionsRouter.js and triggers.js removing the stringified params, results and errors from the message and just leaving them as objects in the meta info object that is also being passed to the logger.

Add the user if it exists to the meta info.

Additionally, add a truncate logs config option that will prevent the logged meta info from going deeper than one level (i.e. if an array of 10 stories is returned, replace contained objects with just the objectId and not the whole object and its contents).

Seeking input here. If there's some agreement that this would be a useful change, I'll cook it up and submit a pr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions