-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow colors for container log messages to be specified in docker-compose.yml #4269
Comments
I second this |
+1 In addition, 'red' should not be removed from the colours to be chosen, as it denotes something has gone wrong. |
+1 This would be incredibly helpful in particular during development phases where you up and down dockers a lot. Colors keep changing each time as of now. |
+1 |
+1. This would be very useful. Right now, it seems that the colors change randomly after each restart. If colors are not made configurable, at least they should stay constant over time. |
+1 Where on the source colors are specified. Like to know how complicated pull request will be. |
+1 Would be great to config this in the docker-compose file :-) |
This would be a great feature. @Rafalsky I think the relevant code starts here: https://github.com/docker/compose/blob/master/compose/cli/log_printer.py#L43-L44
I've looked at it once before, but can't exactly figure out the best way to implement this feature, but hope that helps someone! |
Thanks for the report! It's unlikely that we'd add log output colours to the Compose format but it would definitely help if the colours were deterministic between runs. |
It's very annoying seeing red output to the console when nothing is going wrong -_- |
+1 I spawn test containers with a color themed naming convention, rather then a numeric one. i.e. "container-blue". It is initially confusing when log-color does not match the naming convention for new project-members. |
I'm piping my output through colout as a workaround. Not pretty but works :)
|
+1
|
@xinin After having a look through the code, one can see that the function that sets the color to the log stream output is doing so in a carousel manner from an array of predefined colors (as many of us would have expected), but is totally independent of the rest of the code (in the sense that it has no information about the container the log stream comes from). To make the log color container specific would mean to expand several functions with extra arguments and drag this information down to this level. If I get some free time (which will be a bit tough before this summer) I will take a closer look at it. For anyone interested, here's a jumpstart: Function The |
If at least |
Yes. PLEASE. |
This would be a great feature. |
I have 9 containers starting and one of them has started to show up frequently with a black container name, which is really annoying on my black terminal background. The dark blue isn't much better. |
We're in the process of migrating a shed load of applications to containers and being able to define the colour a service is linked to would be super helpful for our team. |
@jcsirot |
Hi @Greek64, We see the Compose format as a way of modelling container based applications and use it not only for We could consider a |
Yeah, that makes sense.
Intuitively I would say the use case where you want to select a specific color to display for a specific service? I guess #6996 is a good middle ground solution. |
When debugging a particular group of containers run with
docker-compose
, one becomes very familiar with looking for messages reported from a certain color. However, every once in a while these colors unpredictably change. It would be nice if the RGB code could be specified for each container in thedocker-compose.yml
file, to ensure the colors are always what I expect.Including @nweston, whose brought this idea to my attention.
The text was updated successfully, but these errors were encountered: