-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: customize log levels and downgrade common errors to info (#9156)
### What? Allows configuration of the log level based on the error being thrown and also downgrades common errors to be info instead of error by default. ### Why? Currently all errors result in logger.error being called which can polute the logs with junk that is normal and doesn't need attention. ### How? Adds a config property called `loggingLevels` that is used to override the default log levels based on the name of the error being thrown. Sanitize config will provide the defaulted 'info' level errors which can be overriden in the config. Before ![Screenshot 2024-11-12 144459](https://github.com/user-attachments/assets/47318329-23b7-4627-afc4-a0bcf4dc3d58) After ![image](https://github.com/user-attachments/assets/85b06be4-0ab8-4ca2-b237-d6a4d54add3a)
- Loading branch information
1 parent
f264c80
commit d628222
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
export * from './index.js' | ||
|
||
/** | ||
* Error names that can be thrown by Payload during runtime | ||
*/ | ||
export type ErrorName = | ||
| 'APIError' | ||
| 'AuthenticationError' | ||
| 'ErrorDeletingFile' | ||
| 'FileRetrievalError' | ||
| 'FileUploadError' | ||
| 'Forbidden' | ||
| 'Locked' | ||
| 'LockedAuth' | ||
| 'MissingFile' | ||
| 'NotFound' | ||
| 'QueryError' | ||
| 'ValidationError' |