Explanation how view log files

Fix #137

* Better description how to find log files
* Change default log to file but can be overridden by env var
This commit is contained in:
Holger Lösken
2020-05-11 09:08:59 +02:00
committed by Samuel Laulhau
parent 4f3f7ca8fe
commit 8a6622bbbb
2 changed files with 27 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ docker run -d \
-e DB_DATABASE='ninja' \
-e DB_USERNAME='ninja' \
-e DB_PASSWORD='ninja' \
-e LOG=errorlog \
-p '9000:9000' \
invoiceninja/invoiceninja
```
@@ -67,6 +68,32 @@ Run `cp .env.example .env` and change the environment variables as needed.
The file assumes that all your persistent data is mounted from `/srv/invoiceninja/`.
Once started, the application should be accessible at http://localhost:8000.
## Debugging your Docker setup
Even when running your Invoice Ninja setup with Docker - errors can occur. Depending on where the error happens - the webserver, Invoice Ninja or the database - different log files can be responsible.
### Show logs without `docker-compose`
If you are not running the `docker-compose` you first need to find the container id for your php container with `docker ps`. Then you can run
```shell
docker logs -f <CONTAINER NAME>
```
This gives you a constant output of the log files for the php container.
### Show logs with `docker-compose`
If you are running the `docker-compose` setup you can output all logs, from all containers, with the following command
```shell
docker-compose logs -f
```
If you better want a physical log file in in your `storage/logs` folder, just remove this line `-e LOG=errorlog` from the [usage](#usage) command or change it to `-e LOG=single`. Both works.
### Known issues
Phantomjs doesn't work on linux alpine https://github.com/ariya/phantomjs/issues/14186.

View File

@@ -52,7 +52,6 @@ RUN curl -o ninja.zip -SL https://download.invoiceninja.com/ninja-v${INVOICENINJ
######
# DEFAULT ENV
######
ENV LOG errorlog
ENV SELF_UPDATER_SOURCE ''
ENV PHANTOMJS_BIN_PATH /usr/local/bin/phantomjs