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
ConfigDataLoader logging #1173
Comments
@philwebb do you have any insights? |
The The exact order should be:
Adding a breakpoint to |
thank you @philwebb , but it seems to me that we are talking about slightly different issues here.
This is the chain that I was wondering if it's possible to make it work. I hope I make sense. |
If I look at this class here, I notice :
and in this usage here I notice that they override the loggers, otherwise no logging is going to work - just like in our case. Ryan, it seems to me that we will need to do the same thing. A user had a real problem using the app : because there were no logs and he could tell what is wrong. |
If you agree with the above, I have a PR here for fixing it. |
I don't know enough about the internals of |
@wind57 have you tried passing the |
we could, absolutely Ryan. But then there are many other classes that are called internally... which makes this setting impossible. We would have to pass this logger everywhere. I also agree that it's a bit hacky to do it with reflection, but if Vault does it... also, we are in total control here, it's not like we are setting logger from a different library, it's our own. |
either way, we need a solution here and fast (imho), because users using config-data are totally without logs, not being able to tell if anything is wrong at all. |
although I gave up on this idea, I will expres it still: we can use |
I dont think so, we leave the creation of the logger as is just not making it |
OK, so you are saying that But |
Yeah, I guess we would end up passing the logger around. But wouldn't that be the same problem with reflections where we would have to be calling all these classes and setting the logger in them? |
imho, reflection is easier to manage, and no obscure code in the logic of how things are really done. There would be additions of public methods for those setters. It's a lot easier to manage too, if u ask me. The code is common, all we need is say which classes to be updated, in case we find more. |
@philwebb what do you think? I like you don't think reflection is the right approach, but we can't be the only project (in fact Vault also is suffering from this) that would have the pass the Logger around in order to get things working. |
We should replace the question label with a bug label |
I was also wondering, considering the timelines for the next release (which I don't know what is), what if we have some solution in (even the reflection one), but keep this issue open in case we come up with something smarter? I feel weird for the fact that we made some good work on that config-data functionality and it's kind of useless in case things don't work :( |
The release will happen either tomorrow or today. I would rather not rush. The feature still works, its just logging that is the problem so this is not a blocker IMO. A service release will certainly be planned shortly after because as always we will have issues that come up. |
No, it's unfortunately a bit of a tricky issue and I don't really have a good suggestion. We have spring-projects/spring-boot#28678 open in Spring Boot to look at it generally, but we're unlikely to get to it anytime soon. |
seems to me like we won't have an option |
of course! happy Holidays in such a case Ryan! |
you too! |
I have two proposals of implementations to may be solve this: one here that uses the new feature of JDK : hidden classes. another one here, that just uses reflection. |
Thanks! I guess I am a little hesitant to make big changes, to just rip them all out when Boot fixes the issue. |
If they fix the issue, as @philwebb says there are no plans for this one in the near future. Personally, I see no problems with either hidden classes nor reflection, as long as we provide logging for the end-users. To ease the transition in the future, I wanted to:
I feel somehow awkward having even a band-aid, but then not providing it... just my 0.02$ |
@philwebb does this still seem like its going to happen in the near future? |
I sound like a broken record here, still, what is a path forward here? If any. I am not trying to be pushy at all, it's just that this issue stays like a knot in my throat after all the pain I had to go with the user that reported it, nothing else :) thank you upfront. |
@ryanjbaxter random 2 weeks reminder... :) |
I have discussed this issue with a number of people on the team, ultimately everyone has come back to the point that the amount of code needed to fix the issue outweighs the issue itself. We would be much more concerned if this caused the application to not work properly, but ultimately the app will work fine, we just might run into some trouble debugging things. I think at this point we close this issue, as its something Spring Boot needs to address. I also want to acknowledge your effort in trying to find a viable solution to the problem, that has not gone unnoticed 🙌 |
oh it was a fun issue digging in! I just feel already bad for whomever is going to triage an issue when it comes (like the one we had) and logs are mute :) but I can't disagree either... Closing. I am also going to close the two PRs I had with proposals. |
I was looking at an issue that a user reported, and while debugging it saw an interesting thing.
In
KubernetesConfigDataLoader
, if we added some logging, for example:DeferredLogFactory
is injected and I do see the logs I generate. But then, this method calls:propertySources.add(bootstrapContext.get(ConfigMapPropertySourceLocator.class).locate(env));
orConfigMapPropertySourceLocator::locate
and the logs there are not present. I've tried to play around withDeferredLog
, but with no luck.I also saw this issue, but again, did not either understand or did not implement correctly.
Any hints into the direction of how to log these would be lovely, if any is possible at all.
Without this, we are kind of blind what is going on
The text was updated successfully, but these errors were encountered: