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

Add mechanism to disable decorating in runtime #30

Open
gavlyukovskiy opened this issue Apr 11, 2019 · 2 comments
Open

Add mechanism to disable decorating in runtime #30

gavlyukovskiy opened this issue Apr 11, 2019 · 2 comments
Assignees

Comments

@gavlyukovskiy
Copy link
Owner

For some projects there is no need in consistent logging of queries, but when some strange behavior was noticed. In this case it would be helpful to be able to disable decorating through spring cloud config.

see p6spy/p6spy#460

@geoffreywiseman
Copy link

I might, for instance, like to use P6Spy or datasource-proxy in a test configuration but not in prod; I don't see anything in the README to address this kind of approach.

@gavlyukovskiy
Copy link
Owner Author

@geoffreywiseman one option is disable decorating at non test environments (application.properties/yml in main sources) - decorator.datasource.enabled=false, it's mentioned in the very end of README. And then override this option only for tests using either separate test config file or @SpringBootTest(properties = "decorator.datasource.enabled=true"), there are also different options supported by Spring Boot.
In this case p6spy/datasource-proxy and decorator code will be on the classpath, but decorating will be disabled. If you want completely exclude it from the classpath you can configure your build tool to make starter a test dependency.

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

2 participants