osixia / docker-openldap

OpenLDAP container image 🐳🌴
MIT License
4.03k stars 974 forks source link

Huge log #18

Open yagilm opened 9 years ago

yagilm commented 9 years ago

The container seems to generate huge amount of logs! /var/lib/docker/containers//-json.log And since docker has problems with logging / memory usage it takes it(docker) all down. Is there a way to log to syslog rather than to stdout/stderr?

osixia commented 9 years ago

For a quick fix, consider using LDAP_LOG_LEVEL environment variable to decrease the log level. See readme.md.

An idea to log to syslog (not tested) : Add /container/tool/install-multiple-process-stack in a RUN statement in your dockerfile (after an apt-get update). This tool from : https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-multiple-process-stack will install syslog-ng and logrotate like it's done in https://github.com/phusion/baseimage-docker

you can then manage to disable syslog-ng log forwarding to docker.

yagilm commented 9 years ago

Yes, that is the solution. Unfortunately when changing the log level from inside the container with ldapmodify, it doesn't really change because slapd still runs with the old option -d LOG_LEVEL.

ondrowan commented 8 years ago

@osixia Are you planning to implement logrotate by default at some point? This seems to be a pretty serious issue.

osixia commented 8 years ago

Hello @ondrowan, i'm not planning to fix this issue because i don't think adding logrotate in the container would be a good solution, but we can discuss that.

As it is today, all slapd logs go to docker. I really don't want to have these logs inside the container, that would require to go in the container to manage them or search information. If you have 1 container it's may be a solution but if you have 100 clearly not.

For me the easiest way to manage logs it's to have logs redirected to docker that redirect them else where like to journald or fluentd using docker logging drivers: https://docs.docker.com/reference/logging/overview/

But i agree that having these logs in a huge json file (docker default loggin driver) is not a good option.

ondrowan commented 8 years ago

I didn't know you could redirect docker logs. That seems to be a great solution for me. Thanks!

Maybe it'd be a good idea to mention problems with default logging setup (with possible workarounds) in readme.