payload icon indicating copy to clipboard operation
payload copied to clipboard

Error log is polluted with interface messages

Open yobottehg opened this issue 1 year ago • 2 comments

Link to reproduction

No response

Payload Version

3.0.0-beta.68

Node Version

20 LTS latest

Next.js Version

15.0.0-canary.57

Describe the Bug

After running 3.0 on prod for some days I checked the container logs to reproduce some issues authors reported. This is very hard as the logs are full of interface messages which are not application errors like:

  1. [13:28:24] [31mERROR[39m: [36mu: The email or password provided is incorrect.
  2. [13:16:15] [31mERROR[39m: [36ml: The following field is invalid: alt
  3. [14:08:19] [31mERROR[39m: [36ml: The following field is invalid: content.4.video

IMHO this should only be notices / info in the logs but not application errors.

Reproduction Steps

Check error logs in the container after trying to save an invalid field collection entry.

Adapters and Plugins

db-postgres

yobottehg avatar Aug 15 '24 06:08 yobottehg

Updated to Beta 78 and Next.js 104 today and this is still the same.

yobottehg avatar Aug 15 '24 14:08 yobottehg

This is because the way errors are passed to the front end are via error messages. I wouldn't necessarily consider this an issue. We could look into possibly adding a flag that would make it so public errors are not logged.

denolfe avatar Aug 23 '24 19:08 denolfe

In 3.0 we shipped this feature https://github.com/payloadcms/payload/pull/9156 that allows you to customize logs

r1tsuu avatar Dec 02 '24 17:12 r1tsuu

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Dec 04 '24 04:12 github-actions[bot]