Skip to content
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

LeaseAwareVaultPropertySource no longer logs INFO messages during ConfigData bootstrap #565

Closed
Asky-GH opened this issue Jan 19, 2021 · 8 comments
Milestone

Comments

@Asky-GH
Copy link

Asky-GH commented Jan 19, 2021

After migrating to spring-boot-starter-parent 2.4.2 and spring-cloud-vault-config/spring-cloud-starter-vault-config 3.0.0 LeaseAwareVaultPropertySource no longer logs INFO messages if I intentionally add some non-existing Vault path to spring.config.import. I wanted to ask if it's by design or it's a bug.

@Asky-GH Asky-GH changed the title LeaseAwareVaultPropertySource no longer logs INFO messages when supplied Vault location is not resolvable: Not found LeaseAwareVaultPropertySource no longer logs INFO messages when the supplied Vault location is not resolvable: Not found Jan 19, 2021
@mp911de
Copy link
Member

mp911de commented Jan 20, 2021

If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem.

@Asky-GH
Copy link
Author

Asky-GH commented Jan 20, 2021

legacy.zip
modern.zip
Here are examples. The problem is that when using legacy approach I can see the following message in the console output:
2021-01-20 18:14:25.281 INFO 21488 --- [ main] o.s.v.c.e.LeaseAwareVaultPropertySource : Vault location [secret/app/some-vault-path-with-a-typo] not resolvable: Not found
But with the modern approach, such a useful message is absent.

@mp911de
Copy link
Member

mp911de commented Jan 25, 2021

Thanks a lot. The issue is caused by the logging config not being configured yet at the time the Vault interaction is happening. You can use for now spring.cloud.vault.fail-fast=true to get feedback from the app if the startup of a Vault component fails.

@Asky-GH
Copy link
Author

Asky-GH commented Jan 25, 2021

Thanks a lot. The issue is caused by the logging config not being configured yet at the time the Vault interaction is happening. You can use for now spring.cloud.vault.fail-fast=true to get feedback from the app if the startup of a Vault component fails.

spring.cloud.vault.fail-fast=true is already being used but it doesn't provide any useful feedback.

@mp911de
Copy link
Member

mp911de commented Jan 25, 2021

As it looks right now, the lifecycle is controlled from Spring Boot and we don't have any means to do anything useful here. It would make sense to follow up in https://github.com/spring-projects/spring-boot/issues.

@mp911de
Copy link
Member

mp911de commented Jan 25, 2021

After consulting with the Boot Team, we could work around the logging issue by obtaining a specific logger that captures startup logs and prints these later on.

@wilkinsona
Copy link

I've opened an issue to help with this on the Boot side: spring-projects/spring-boot#24988. I think that's a prerequisite to fixing this as you need a DeferredLogFactory, not just a Log that is deferred.

andreasgebauer pushed a commit to andreasgebauer/spring-cloud-vault that referenced this issue Jan 27, 2021
@mp911de
Copy link
Member

mp911de commented Mar 10, 2021

Depends on spring-projects/spring-vault#636.

@mp911de mp911de added this to the 3.0.2 milestone Mar 10, 2021
@mp911de mp911de changed the title LeaseAwareVaultPropertySource no longer logs INFO messages when the supplied Vault location is not resolvable: Not found LeaseAwareVaultPropertySource no longer logs INFO messages during ConfigData bootstrap Mar 10, 2021
spencergibb pushed a commit that referenced this issue Sep 14, 2023
…strap.

We now reconfigure loggers through reflection of VaultPropertySource, SecretLeaseContainer and other components to obtain log events during the bootstrap.

Closes gh-565.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants