# How to set DEBUG environment variables using Keycloak K8S Operator?

**URL:** <https://forum.keycloak.org/t/how-to-set-debug-environment-variables-using-keycloak-k8s-operator/4657>\
**Category:** Configuring the server\
**Created:** [September 2, 2020, 9:30am UTC](https://forum.keycloak.org/t/how-to-set-debug-environment-variables-using-keycloak-k8s-operator/4657 "2020-09-02T09:30:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjmc](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bjmc](https://forum.keycloak.org/u/bjmc)\
**Post date:** [September 2, 2020, 9:30am UTC](https://forum.keycloak.org/t/how-to-set-debug-environment-variables-using-keycloak-k8s-operator/4657/1 "2020-09-02T09:30:50Z")

</div>

I’m trying to work through a database connection error, and I’d like to enable debug logging to get more information about the problem.

According [to this StackOverflow post](https://stackoverflow.com/questions/58060682/get-keycloak-server-logs) it’s possible to enable extra logging by setting environment variables like `KEYCLOAK_LOGLEVEL=DEBUG`

However, looking at the [Keycloak custom resource definition](https://github.com/keycloak/keycloak-operator/blob/master/deploy/crds/keycloak.org_keycloaks_crd.yaml) I can’t see any way to specify environment variables to propagate to the Keycloak pods.

Is there something I’m missing? Or another way to achieve the same result of enabling debug logging?

---

<div class="post-metadata">

**Author:** ![jonathanvila](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/jonathanvila/32/1481_2.png) [@jonathanvila](https://forum.keycloak.org/u/jonathanvila)\
**Post date:** [December 24, 2021, 8:39am UTC](https://forum.keycloak.org/t/how-to-set-debug-environment-variables-using-keycloak-k8s-operator/4657/2 "2021-12-24T08:39:16Z")

</div>

You can add that information in the Keycloak CR , below spec :  
keycloakDeploymentSpec:  
experimental:  
env:  
- name: KEYCLOAK\_LOGLEVEL  
value: DEBUG
