Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
webhooks: Configure webhook loggers in zproject/computed_settings.py.
Alex Vandiverb8a2e6b5f852
diff --git a/zerver/decorator.py b/zerver/decorator.pyindex 53cf4b5ff03..b49092cb20a 100644--- a/zerver/decorator.py+++ b/zerver/decorator.py@@ -34,7 +34,6 @@ from zerver.lib.exceptions import (OrganizationOwnerRequired,UnsupportedWebhookEventType,)-from zerver.lib.logging_util import log_to_filefrom zerver.lib.queue import queue_json_publishfrom zerver.lib.rate_limiter import RateLimitedUserfrom zerver.lib.request import REQ, has_request_variables@@ -50,11 +49,7 @@ if settings.ZILENCER_ENABLED:from zilencer.models import RemoteZulipServer, get_remote_server_by_uuidwebhook_logger = logging.getLogger("zulip.zerver.webhooks")-log_to_file(webhook_logger, settings.WEBHOOK_LOG_PATH)-webhook_unsupported_events_logger = logging.getLogger("zulip.zerver.webhooks.unsupported")-log_to_file(webhook_unsupported_events_logger,- settings.WEBHOOK_UNSUPPORTED_EVENTS_LOG_PATH)FuncT = TypeVar('FuncT', bound=Callable[..., object])diff --git a/zproject/computed_settings.py b/zproject/computed_settings.pyindex 1b3a29dfb6c..2409066c808 100644--- a/zproject/computed_settings.py+++ b/zproject/computed_settings.py@@ -791,6 +791,18 @@ LOGGING: Dict[str, Any] = {'formatter': 'default','filename': SLOW_QUERIES_LOG_PATH,},+ 'webhook_file': {+ 'level': 'DEBUG',+ 'class': 'logging.handlers.WatchedFileHandler',+ 'formatter': 'default',+ 'filename': WEBHOOK_LOG_PATH,+ },+ 'webhook_unsupported_file': {+ 'level': 'DEBUG',+ 'class': 'logging.handlers.WatchedFileHandler',+ 'formatter': 'default',+ 'filename': WEBHOOK_UNSUPPORTED_EVENTS_LOG_PATH,+ },},'loggers': {# The Python logging module uses a hierarchy of logger names for config:@@ -937,12 +949,12 @@ LOGGING: Dict[str, Any] = {},'zulip.zerver.webhooks': {'level': 'DEBUG',- 'handlers': ['file', 'errors_file'],+ 'handlers': ['webhook_file'],'propagate': False,},'zulip.zerver.webhooks.unsupported': {'level': 'DEBUG',- 'handlers': ['file', 'errors_file'],+ 'handlers': ['webhook_unsupported_file'],'propagate': False,},},