Hello community,
running Kibana v8.14.1 in its own Docker container.
Issue:
configuring Kibana to write its log file to /var/log/kibana.log, following the guidance in the Kibana logging settings documentation:
I encounter an EACCES: permission denied error related to /var/log/kibana.log.
This is because the /var/log directory inside the Kibana container is owned by root:root, and Kibana, running as a non-root user inside the container, does not have permission to write to it.
Does anyone encounter similar issue and how to fix it, thanks
****error:
Container elastic-stack-13jul-kibana-1 Error
$ sudo docker logs -f 5601f4e7f681
[Error: EACCES: permission denied, open '/var/log/kibana.log'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/var/log/kibana.log'
}
docker compose and yml files
---docker-compose.yml---
...
kibana:
depends_on:
elasticsearch01:
condition: service_healthy
image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
# user: --allow-root
labels:
co.elastic.logs/module: kibana
volumes:
- certs:/usr/share/kibana/config/certs
- kibanadata:/usr/share/kibana/data
- "./kibana.yml:/usr/share/kibana/config/kibana.yml"
ports:
- ${KIBANA_PORT}:5601
environment:
- SERVERNAME=kibana
- ELASTICSEARCH_HOSTS=https://elasticsearch01:9200
- ELASTICSEARCH_USERNAME=kibana_system
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}
- ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt
- XPACK_SECURITY_ENCRYPTIONKEY=${ENCRYPTION_KEY}
- XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=${ENCRYPTION_KEY}
- XPACK_REPORTING_ENCRYPTIONKEY=${ENCRYPTION_KEY}
...
---$ cat kibana.yml---
logging:
appenders:
file:
type: file
fileName: /var/log/kibana.log
layout:
type: pattern
root:
appenders: [file]