Skip to content

Commit 042894c

Browse files
committed
Log master to stdout (really, Docker's log mechanism)
1 parent 0e3f521 commit 042894c

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ services:
99
POSTGRES_DB: buildbot
1010
POSTGRES_USER: buildbot
1111
POSTGRES_PASSWORD_FILE: /run/secrets/db_password.txt
12+
logging:
13+
driver: local
1214
restart: unless-stopped
1315

1416
buildbot:
@@ -31,6 +33,8 @@ services:
3133
environment:
3234
HALIDE_BB_MASTER_ARTIFACTS_DIR: /artifacts
3335
HALIDE_BB_MASTER_SECRETS_DIR: /run/secrets
36+
logging:
37+
driver: local
3438
restart: unless-stopped
3539

3640
caddy:
@@ -44,6 +48,8 @@ services:
4448
- caddy-data:/data
4549
- caddy-config:/config
4650
- ${HALIDE_BB_MASTER_ARTIFACTS_DIR:-./data/artifacts}:/artifacts:ro
51+
logging:
52+
driver: local
4753
restart: unless-stopped
4854

4955
volumes:

master/buildbot.tac

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
import os
1+
import sys
22
from pathlib import Path
33

44
from buildbot.master import BuildMaster
55
from twisted.application import service
6-
from twisted.python.log import ILogObserver, FileLogObserver
7-
from twisted.python.logfile import LogFile
8-
9-
basedir = str(Path(__file__).parent.resolve())
10-
rotateLength = 10000000
11-
maxRotatedFiles = 10
12-
configfile = "master.cfg"
13-
14-
# Default umask for server
15-
umask = None
16-
17-
logfile = LogFile.fromFullPath(
18-
os.path.join(basedir, "twistd.log"), rotateLength=rotateLength, maxRotatedFiles=maxRotatedFiles
19-
)
6+
from twisted.logger import ILogObserver, textFileLogObserver
207

218
# note: this line is matched against to check that this is a buildmaster
229
# directory; do not edit it.
2310
application = service.Application('buildmaster') # fmt: skip
24-
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
11+
application.setComponent(ILogObserver, textFileLogObserver(sys.stdout))
2512

26-
m = BuildMaster(basedir, configfile, umask)
13+
m = BuildMaster(str(Path(__file__).parent), "master.cfg", umask=None)
2714
m.setServiceParent(application)
28-
m.log_rotation.rotateLength = rotateLength
29-
m.log_rotation.maxRotatedFiles = maxRotatedFiles

0 commit comments

Comments
 (0)