-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Guideline for log message level #4751
Comments
Thanks @jo-so at first glance this look very sensible, we've recently made changes to reduce the number of error level debug logs, so hopefully you should start to see some difference right away. |
I feel like every new homeowner complains about getting so many logs by default, specifically a lot of |
any sane admin is usually not interested running service with "too" verbose logging, because this can create noticeable I/O spikes and even exhaustion to the point that other processes wait in D-state and from there you can easily have cascading failure. YMMV. I have no idea how many people actually run Synapse on Raspberry Pi with sdcard or similar low powered devices (which isn't good idea, imho), but considering how often some people ask about that in public rooms... Synapse should have smarter error logging: only log errors and stacktraces by default and do not pollute log with warnings and informational messages which aren't useful when running production service. if I get asked (again) "can you please make issue with logs", I have to turn loglevel up and wait before I get any meaningful information and same time generate loads of I/O. yes, I understand that having verbose logging makes stuff easier and of course I can forward logs, before even touching disk, to remote syslog, but that's not always an option. @ara4n showed document yesterday about room complexity metric and displaying warning before joining resource hungy rooms. imho getting logging smarter by default helps a lot with this kind of "problems" too. |
This is exactly why the default log level is INFO, not WARNING or ERROR. You can turn the level down if you want to save on disk space or I/O, but don't be surprised if we can't debug any problems without at least the INFO logs. Certainly the situation isn't perfect at the moment. For instance, there is stuff that ends up logged at ERROR that shouldn't be, either because our error handling is poor, or that of twisted or some other library is. Feel free to open issues for any specific cases that you see (though please check for open issues first). In the specific case of unreachable homeservers: the reason it's logged at WARNING is because we believe it is useful information if you can't send messages to your friend's server. I appreciate that, if you're in one of the big public rooms, the useful information gets drowned out by the hundreds of servers which have permanently gone away, but I think the solution to that is something like #5113. I'm not quite sure what to do with this issue. We could add some guidelines to our coding style documentation, but I'm not entirely sure it would make any difference. We already apply some amount of thought to what we log at what level, and it's guided by our experience of what goes wrong and the information that we need to debug it. It's not clear how a document describing the difference between "warning" and "info" would improve this. Rather, I think it would be more instructive to discuss individual cases which are either useless or at the wrong log level. |
@richvdh Please re-open. On the current release (1.73.0) I still get around 1 GB of logs like this every day:
This should not be in the log as "WARNING". |
No. As I said before:
|
The log is not much use in its current form. Messages like these two should be EDIT: Or maybe even in the Notices category. |
Description
I think it would be helpful to have a guideline that defines, which log level should be used for which kind of messages. I'm getting tons of messages in my system log on error or warning level where I can't do anything about it. This makes supervising of Synapse impossible, because it raises the flag too often.
Proposal
Error
Warn
Notice
Info
Debug
The text was updated successfully, but these errors were encountered: