# How to set a logLevel for Elasticsearch and Kibana CustomResource?

**URL:** <https://discuss.elastic.co/t/how-to-set-a-loglevel-for-elasticsearch-and-kibana-customresource/239038>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [June 29, 2020, 1:34am UTC](https://discuss.elastic.co/t/how-to-set-a-loglevel-for-elasticsearch-and-kibana-customresource/239038 "2020-06-29T01:34:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![esther.k](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/esther.k/32/67343_2.png) [@esther.k](https://discuss.elastic.co/u/esther.k)\
**Post date:** [June 29, 2020, 1:34am UTC](https://discuss.elastic.co/t/how-to-set-a-loglevel-for-elasticsearch-and-kibana-customresource/239038/1 "2020-06-29T01:34:10Z")

</div>

Hi,

I'm currently using Elastic Operator v1.1.1.  
In my environment, Elasticsearch and Kibana has too many logs so it's difficult to figure out the problems and status of them.

Can you let me know how to set a log level for Elasticsearch/Kibana?  
I couldn't find any fields in elasticsearch, kibana crd files.

---

<div class="post-metadata">

**Author:** ![charith-elastic](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@charith-elastic](https://discuss.elastic.co/u/charith-elastic)\
**Post date:** [June 29, 2020, 7:40am UTC](https://discuss.elastic.co/t/how-to-set-a-loglevel-for-elasticsearch-and-kibana-customresource/239038/2 "2020-06-29T07:40:17Z")

</div>

You can use the configuration options provided by [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html#configuring-logging-levels) and [Kibana](https://www.elastic.co/guide/en/kibana/current/settings.html). The easiest option would be to use the `config` field to modify `elasticsearch.yaml` or `kibana.yaml` as follows:

```auto
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: hulk
spec:
  version: 7.8.0
  nodeSets:
  - name: default
    count: 3
    config:
      logger.org.elasticsearch: warn
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: hulk
spec:
  version: 7.8.0
  count: 1
  elasticsearchRef:
    name: hulk
  config:
    logging.quiet: true

```

You can also use environment variables if you prefer that approach:

```auto
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: hulk
spec:
  version: 7.8.0
  nodeSets:
  - name: default
    count: 3
    podTemplate:
      spec:
        containers:
          - name: elasticsearch
            env:
              - name: logger.org.elasticsearch
                value: warn
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: hulk
spec:
  version: 7.8.0
  count: 1
  elasticsearchRef:
    name: hulk
  podTemplate:
    spec:
      containers:
        - name: kibana
          env:
            - name: LOGGING_QUIET
              value: "true"

```

If you need more control, you can also craft your own log4j configuration file as described in [Log4j Configuration](https://discuss.elastic.co/t/log4j-configuration/220565).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:04am UTC](https://discuss.elastic.co/t/how-to-set-a-loglevel-for-elasticsearch-and-kibana-customresource/239038/3 "2022-11-04T08:04:15Z")

</div>


