Support for LOG_LEVEL configuration (other than "info")
Closed this issue · 1 comments
We're using vault-crd
in both production and nonproduction services. This lead us to creating quite a lot of separate environments, and thus instances where vault-crd is used.
We're currently generating around 100k logs per day with vault-crd
, most of which are INFO
logs like this:
2023-03-28 16:25:29.422 INFO 1 --- [ool-1-thread-74] d.koudingspawn.vault.kubernetes.Watcher : Received scheduled refresh for .. in namespace ...
We're now paying around $78/mo just for these logs... 😅 Yeah, I know, Datadog is expensive... but we're not in a position to easily change it.
Q: Is it possible to switch the LOG_LEVEL
to ERROR
?
Alright... I've managed to fix this problem.
It appears you can adjust Java Sprint root logging level by injecting a LOGGING_LEVEL_ROOT
env var into the runtime:
- name: LOGGING_LEVEL_ROOT
value: WARN
full example:
containers:
- name: vault-crd
image: daspawnw/vault-crd:1.11.0
imagePullPolicy: IfNotPresent
env:
- name: LOGGING_LEVEL_ROOT
value: WARN
- name: KUBERNETES_VAULT_URL
value: "https://vault.mycompany.com/"
- name: KUBERNETES_VAULT_TOKEN
valueFrom:
secretKeyRef:
key: token
name: "vault-crd-vault-token"
This worked beautifully for me. I would be happy to add a note about this to the documentation here https://vault.koudingspawn.de/install-vault-crd#configuration-of-vault-crd, but it's tracked in a different git repository. Anyway, it could be a good idea to put a mention about this in the env vars config, @DaspawnW :) if you point me to the right repo, I can open up a PR and let GPT write a nice description 😅