Skip to content

Include thread name with each log line

Marios Hadjimichael requested to merge marios/add-thread-name-in-logs into master

Description

We seem to have a very convoluted threading model.

Let's start unraveling this by including the thread name in each log line.

The log format should now look like:

2019-10-17 14:43:46,275:[/Users/mhadjimichae/gitlab/BuildGrid][ INFO][MainThread]: Using in-memory data store interface
2019-10-17 14:43:46,282:[           buildgrid.server.instance][DEBUG][MainThread]: Setting up gRPC server with thread-limit=[5]
2019-10-17 14:43:46,283:[           buildgrid.server.instance][ INFO][MainThread]: Adding insecure connection on [[::]:50051]
2019-10-17 14:43:46,286:[      buildgrid.server.bots.instance][ INFO][MainThread]: Starting BotSession reaper, bot_session_keepalive_timeout=[0.25].
2019-10-17 14:43:46,286:[      buildgrid.server.bots.instance][DEBUG][MainThread]: No more BotSessions to watch for expiry, waiting for new BotSessions.
2019-10-17 14:46:26,040:[       buildgrid.server.bots.service][DEBUG][ThreadPoolExecutor-0_0]: CreateBotSession request from [ipv4:10.55.66.120:55623]
2019-10-17 14:46:26,040:[      buildgrid.server.bots.instance][ INFO][ThreadPoolExecutor-0_0]: Opened session bot_name=[/249879a8-c4eb-4ce0-9f76-916de7a5adc0] for bot_id=[2f1394296a52-370], leases=[]
2019-10-17 14:46:26,041:[      buildgrid.server.bots.instance][DEBUG][MainThread]: Checking for next session to reap...
2019-10-17 14:46:26,041:[      buildgrid.server.bots.instance][DEBUG][MainThread]: Waiting for an event indicating earlier expiry or wait=[2] for a the next BotSession to expire.
2019-10-17 14:46:26,045:[       buildgrid.server.bots.service][DEBUG][ThreadPoolExecutor-0_0]: UpdateBotSession request from [ipv4:10.55.66.120:55623]
2019-10-17 14:46:26,045:[      buildgrid.server.bots.instance][DEBUG][ThreadPoolExecutor-0_0]: Sending session update, name=[/249879a8-c4eb-4ce0-9f76-916de7a5adc0], for bot=[2f1394296a52-370], leases=[]
2019-10-17 14:46:26,047:[      buildgrid.server.bots.instance][DEBUG][MainThread]: Checking for next session to reap...
2019-10-17 14:46:26,047:[      buildgrid.server.bots.instance][DEBUG][MainThread]: Waiting for an event indicating earlier expiry or wait=[2] for a the next BotSession to expire.

Merge request reports