From 7958375fb5c031df879f81eda5698ea406896332 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 4 Jul 2023 08:18:07 +0200 Subject: [PATCH] [IMP] runbot: log container short id When investigating kernel logs e.g.: for finding oom killed containers, the kernel does not log the name of the incriminated container but only the id. With this commit the runbot will also log the container short id which is enough to correlate the logs. --- runbot/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/container.py b/runbot/container.py index 0c3ed015..d17ae7a9 100644 --- a/runbot/container.py +++ b/runbot/container.py @@ -192,7 +192,7 @@ def _docker_run(cmd=False, log_path=False, build_dir=False, container_name=False if container.status not in ('running', 'created') : _logger.error('Container %s started but status is not running or created: %s', container_name, container.status) # TODO cleanup else: - _logger.info('Started Docker container %s', container_name) + _logger.info('Started Docker container %s (%s)', container_name, container.short_id) return