Skip to content

Print containerAlias into logs to distinguish between same image containers#11367

Closed
bedla wants to merge 1 commit intotestcontainers:mainfrom
bedla:container-name-logger
Closed

Print containerAlias into logs to distinguish between same image containers#11367
bedla wants to merge 1 commit intotestcontainers:mainfrom
bedla:container-name-logger

Conversation

@bedla
Copy link
Copy Markdown
Contributor

@bedla bedla commented Dec 22, 2025

Hi,
this PR fixes #2246 feature request to display container aliases in the logs to distinguish between them when reading logs.
Please take a look, what do you think?
Thx
Ivos

Sample of the logs after change:

15:44:46.231 INFO  tc.alpine:3.17--potato - Creating container for image: alpine:3.17
15:44:46.310 INFO  tc.alpine:3.17--potato - Container alpine:3.17 is starting: 54fe7af01a03c02c30a1e7614764a0b4be2cdaf6f45f5745a1752326e1df59b6
15:44:46.840 INFO  tc.alpine:3.17--potato - Container alpine:3.17 started in PT0.608617S
15:44:46.848 INFO  tc.alpine:3.17--monkey - Creating container for image: alpine:3.17
15:44:46.912 INFO  tc.alpine:3.17--monkey - Container alpine:3.17 is starting: 09fa4875896e95e934c8bee677726cbd7e8b06fc5c6d678b2d166cd4f3d3af46
15:44:47.020 ERROR tc.alpine:3.17--monkey - Could not start container

@bedla bedla requested a review from a team as a code owner December 22, 2025 14:50
@eddumelendez
Copy link
Copy Markdown
Member

I would avoid introducing a new public method with only purpose is as log identifier. I think something like described here can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display name for GenericContainer

2 participants