From ab3b831e11a3b4a8625afe1807fab083b7a12845 Mon Sep 17 00:00:00 2001 From: Peter Paul Bakker Date: Wed, 21 Oct 2026 07:24:14 +0000 Subject: [PATCH] docs: document logging, fix badges and issues link --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8c0bb44..b0afb2a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,27 @@ # Java Buildpack Security Provider -| Job | Status -| --- | ------ -| `unit-test-8` | [![unit-test-master](https://java-experience.ci.springapps.io/api/v1/teams/java-experience/pipelines/security-provider/jobs/unit-test-8/badge)](https://java-experience.ci.springapps.io/teams/java-experience/pipelines/security-provider/jobs/unit-test-8) -| `deploy` | [![deploy-master](https://java-experience.ci.springapps.io/api/v1/teams/java-experience/pipelines/security-provider/jobs/deploy/badge)](https://java-experience.ci.springapps.io/teams/java-experience/pipelines/security-provider/jobs/deploy) +[![CI](https://github.com/cloudfoundry/java-buildpack-security-provider/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cloudfoundry/java-buildpack-security-provider/actions/workflows/ci.yml) The `java-buildpack-security-provider` is a utility that watches for changes to container identity and trust stores and dynamically updates the KeyManager and TrustManager of an application. +The [Java buildpack](https://github.com/cloudfoundry/java-buildpack/blob/main/docs/framework-container_security_provider.md) installs it in every Java application; its documentation covers what it adds and how to disable the KeyManager or TrustManager. + +## Logging +The provider logs through `java.util.logging`, with loggers named after its classes in the `org.cloudfoundry.security` package. At the default `INFO` level it logs each certificate load. `FINE` adds details such as the file events seen by the watcher, which show the order in which the certificate and private key files were replaced: + +``` +FINE org.cloudfoundry.security.FileWatcher: Discarding unimportant file change: instance.key +INFO org.cloudfoundry.security.FileWatchingX509ExtendedKeyManager: Updated KeyManager for ... +``` + +In a Spring Boot application, set the level like any other logger, e.g. with the environment variable `LOGGING_LEVEL_ORG_CLOUDFOUNDRY_SECURITY=DEBUG`. Otherwise, point `java.util.logging` at a configuration file shipped with the application, e.g. with `JAVA_OPTS: -Djava.util.logging.config.file=`; the file replaces the default configuration, so it needs a handler as well: + +```properties +handlers=java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.level=FINE +org.cloudfoundry.security.level=FINE +``` + ## Development The project depends on Java 8. To build from source, run the following: @@ -22,6 +37,6 @@ See [docs/RELEASE.md](docs/RELEASE.md) for how to cut a release, how it reaches ## License This project is released under version 2.0 of the [Apache License][l]. -[e]: https://github.com/cloudfoundry/security-provider/issues +[e]: https://github.com/cloudfoundry/java-buildpack-security-provider/issues [l]: https://www.apache.org/licenses/LICENSE-2.0 [u]: https://help.github.com/articles/using-pull-requests