Exception is not logged when pulling
See original GitHub issueWe are using spring-cloud-config 1.1.0.M3, and currently repeatedly see a warning being logged:
Could not pull remote for master (current ref=Ref[refs/heads/master=386bfc56eb3b12de6e638db20180aedabcdef]), remote: git@bitbucket.org:company/config.git
However, since the Exception is not logged it makes it more difficult to find the actual cause of the problem.
Therefore I would like to propose the following change at JGitEnvironmentRepository, line 220:
catch (Exception e) {
this.logger.warn("Could not pull remote for " + label + " (current ref=" + ref
+ "), remote: " + git.getRepository().getConfig().getString("remote",
"origin", "url"));
}
change to:
catch (Exception e) {
this.logger.warn("Could not pull remote for " + label + " (current ref=" + ref
+ "), remote: " + git.getRepository().getConfig().getString("remote",
"origin", "url"), e);
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to Log Exception Properly - Medium
Common Mistake 1: Not logging anything in `catch` statement · Common Mistake 2: Only log developer's message · Common Mistake 3: Log the...
Read more >Why is the exception stack trace not logged in? [duplicate]
Just tried with log4j as the implementation, and I did get the stack trace. So does JDK logging does not enable to log...
Read more >unhandled exceptions not logged on server #2924 - GitHub
I am experiencing following behavior: In development (local) there is no problem logging exceptions, all kind works. When I logged in remote ...
Read more >Logging in .NET Core and ASP.NET Core | Microsoft Learn
Exception logging is provider-specific. Default log level. If the default log level is not set, the default log level value is Information ....
Read more >Errors & Logging - Services - Winter CMS Documentation
If an exception handler returns a response, that response will be sent to the browser and no other error handlers will be called:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would like to see the error logging being improved as well.
We faced a similar problem which we were not able to track down to it’s root cause. We had an exception being thrown at the place mentioned above and suspected also an exception being thrown in
MultipleJGitEnvironmentRepository#getLocations
but thedid hide the root cause.
While I totally agree that the config-server should be as resilient as possible and should rather serve requests from a local potentially stale cache then not at all, having more information available to fix the root cause would be helpful.
I agree with @skhome. It would be great to log (even in DEBUG without stacktrace for me) error in
MultipleJGitEnvironmentRepository#getLocations
Now the only way for me to find root cause was debugging.