-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
How to use GitHub
- Please use the 👍 reaction to show that you are interested into the same feature.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Is your feature request related to a problem? Please describe.
I have written a good deal of custom security and privacy code/apps for my Nextcloud installation. It is possible that an unknown bug in my code could result in Nextcloud writing sensitive data from my apps to the log.
Additionally, being able to filter logs based on apps, event types, severity level, etc. prior to them being written by the logger would be useful.
Describe the solution you'd like
It would be helpful if the OC\Log
class included an event dispatcher. This way, logged messages could be checked by middleware before being written to the log file.
Describe alternatives you've considered
I'm sure the alternative suggestion would be, "Write better code that doesn't result in secrets being exposed," and that adding event handlers to the logger creates unnecessary complexity. I am pretty confident in the quality of my code . . . but you never know. There are always bugs in code, and having an extra mechanism in place just in case something goes wrong would be a good thing and would help prevent sensitive strings from being logged.
Also, having the ability to filter logs based on the app or event that triggered the message could be very useful for debugging and management.