rroemhild / docker-ejabberd

Dockerfile for Ejabberd server
MIT License
268 stars 160 forks source link

Create /var/log/ejabberd directory or change LOG_DIR to /usr/local/var/log/ejabberd #135

Closed sigmundv closed 7 years ago

sigmundv commented 7 years ago

I noticed that three files are being tailed after startup of the ejabberd server: /var/log/ejabberd/crash.log, /var/log/ejabberd/error.log, and /var/log/ejabberd/erlang.log. The tail command fails, however, because those files, including the path /var/log/ejabberd, do not exist.

Despite the files not existing under /var/log/ejabberd they do exist under /usr/local/var/log/ejabberd/, which was added during installation of ejabberd, so one of two changes should be made:

  1. Change the LOG_DIR variable in the base_config.sh script to "/usr/local/var/log/ejabberd" instead of "/var/log/ejabberd".

  2. Create the directory /var/log/ejabberd and the files crash.log, error.log, and erlang.log in this directory during image creation, i.e. add two steps in the dockerfile.

I have made both of the above mentioned changes, so you can choose either of them to merge to your master if you find them correct.

Alternatively you could add the --localstatedir flag to the ./configure step before compiling ejabberd. This is probably the solution I would prefer.