You can use the configuration options provided by Elasticsearch and Kibana. The easiest option would be to use the config
field to modify elasticsearch.yaml
or kibana.yaml
as follows:
---
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:
---
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.