Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are two independent problems that cause some log messages to be printed twice: * In the CVAT logging configuration, we attach a console handler to the `cvat` and `django` loggers. However, when any library[1] used by CVAT uses one of the top-level `logging` functions (e.g. `logging.info`), then it will cause the root logger to get autoconfigured with another console handler. Since `cvat` and `django` are configured to propagate events to the ancestor logger's handlers, those events are passed to _two_ console handlers, so they are printed twice. Fix it by moving our handlers to the root logger. If the root logger has handlers, it will no longer get autoconfigured when top-level `logging` functions are invoked; so there will only be one console handler in the logger chain. An alternative would be to configure the root logger with a `NullHandler` (which will also disable autoconfiguration), but this will suppress all logs that are coming from places other than Django and CVAT, which seems undesirable. * The supervisord config file for the server redirects the server's stdout to supervisord's stdout. However, supervisord already displays the stdout of all child processes due to the `loglevel=debug` setting. So all stdout messages of the server are displayed twice. Fix it by removing the redirection. [1] Specifically, Datumaro does this. It could probably be fixed, but that wouldn't fix the root problem, which is the duplicate console handler.
- Loading branch information