testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

Add `docker.` prefix to container logger names, to enable log level to be set across all loggers

Open vcvitaly opened this issue 5 years ago • 19 comments

Fixes https://github.com/testcontainers/testcontainers-java/issues/3016

vcvitaly avatar Jul 24 '20 10:07 vcvitaly

@bsideup please review?

vcvitaly avatar Aug 25 '20 05:08 vcvitaly

Sorry for the bump, any chance of reviewing this? I have a feeling this may help deal with #637 where it would be nice to set the log level for all dockers at once instead of matching against the 🐳...

hmemcpy avatar Oct 08 '20 08:10 hmemcpy

@vcvitaly please could you merge from master, or preferably give maintainers permission to edit?

We've had some CI problems, so hopefully updating from master should fix things.

rnorth avatar Oct 15 '20 20:10 rnorth

Overall I think this looks fine and long overdue (sorry for the immense time to review). Let's just see the tests pass once rebased onto master and I think we should be good to go!

rnorth avatar Oct 15 '20 20:10 rnorth

I think it would be fair to say this fixes #637, although not in the way originally proposed.

rnorth avatar Oct 15 '20 20:10 rnorth

@rnorth I just can't find that checkbox to allow edits, I don't have it for some reason. I rebased onto the master.

vcvitaly avatar Oct 16 '20 12:10 vcvitaly

I’m afraid I’ll have to defer this to 1.15.1, so that we can review this together. We’re expecting to publish that release soon after 1.15.0, so it shouldn’t be too much delay.

rnorth avatar Nov 05 '20 19:11 rnorth

@rnorth Anything blocking this from being merged now, given that 1.15.1 is released? Would be incredibly nice to make the container logging be more easily controlled from e.g. logback-test.xml config.

perlun avatar Jun 02 '21 11:06 perlun

@bsideup I think you had some ideas about how this could be done without a change to how it looks for normal use cases?

rnorth avatar Jun 09 '21 16:06 rnorth

Ping @bsideup, would be great to get your feedback on this. (Not myself advocating a particular solution, only eager to see #637 resolved one way or the other)

perlun avatar Sep 07 '21 08:09 perlun

any progress on this? it is a bit more difficult to promote this library when logging is difficult to configure.

(personally, I would prefer an org.testcontainers. prefix, but anything other than root will solve my problems.)

okorz001 avatar Jan 26 '22 21:01 okorz001

Humble ping :slightly_smiling_face: org.testcontainers. is definitely better.

sideeffffect avatar Sep 29 '22 21:09 sideeffffect

Sorry, everyone, I am not sure why we let this go stale for some time now. We will look into it so that we can decide at least whether we will tackle this in a timely manner, or not at all.

kiview avatar Sep 30 '22 10:09 kiview

Sorry, everyone, I am not sure why we let this go stale for some time now. We will look into it so that we can decide at least whether we will tackle this in a timely manner, or not at all.

Sounds good @kiview, any updates on this yet? :relaxed:

perlun avatar Oct 25 '22 15:10 perlun

@vcvitaly - I added some feedback in https://github.com/testcontainers/testcontainers-java/pull/3018/files#r1006459726. If you're still with us, it would be nice to get these final details sorted out before this hopefully gets merged.

If not, I am willing to take ownership of this change to make it be mergable. We really, really need to get this shipped anytime soon. It's a major pain related to e.g. CI logging right now.

perlun avatar Oct 27 '22 06:10 perlun

@vcvitaly - I added some feedback in https://github.com/testcontainers/testcontainers-java/pull/3018/files#r1006459726. If you're still with us, it would be nice to get these final details sorted out before this hopefully gets merged.

If not, I am willing to take ownership of this change to make it be mergable. We really, really need to get this shipped anytime soon. It's a major pain related to e.g. CI logging right now.

@perlun sorry, I almost forgot about this PR) let me review this within two days

vcvitaly avatar Nov 07 '22 17:11 vcvitaly

@kiview I renamed the logger as suggested by the community, please provide your feedback.

vcvitaly avatar Nov 08 '22 07:11 vcvitaly

Ping @kiview, is this mergable now or would it require any further adjustments?

perlun avatar Nov 15 '22 13:11 perlun

@eddumelendez - you seem to have been merging stuff recently. If you could help push things forward on this, it would be very greatly appreciated. :bow: :pray:

perlun avatar Dec 14 '22 12:12 perlun

Anyone who talks to the maintainers recently, please ping them about this. I seem to be unable to get in touch with them despite repeated attempts.

perlun avatar Jan 09 '23 07:01 perlun

Hi, sorry for the delay on this one. We just started discussing about this internally. So, we will be sharing news hopefully soon.

Thanks for your patience.

eddumelendez avatar Jan 11 '23 05:01 eddumelendez

@eddumelendez quite some time has passed since the PR was opened so here is a short review of the reasons why I opened it:

  1. The initial problem was that since the container logs start with the whale emoji or docker prefix, they go under the root INFO hierarchy, and you cannot see debug logs that might be useful if there are issues. I experienced that myself when I was working on another PR to testcontainers and couldn't find an issue for a while because it was printed as debug and effectively not shown. What I did - I just removed the whale emoji from the factory and added the 'docker' prefix with the DEBUG level to the logback-test.xml because I thought that missing debug info is a mistake. I now understand that it was probably a conscious decision.
  2. Since then multiple community members have made complaints that it's hard to configure logging with the whale emoji and that a non-Unicode prefix should be used. I then changed the prefix to org.testcontainers.docker as suggested by @perlun

If something else is required from my side that might speed up pr review, I'd be happy to provide any additional info.

vcvitaly avatar Jan 24 '23 06:01 vcvitaly

#6781 has been created in order to tackle this. Thanks for your contribution @vcvitaly

eddumelendez avatar Mar 14 '23 18:03 eddumelendez