mirror of
https://github.com/tinode/chat.git
synced 2025-03-14 10:05:07 +00:00
Revert docker setup to write logs to /var/log/tinode.log.
This commit is contained in:
@ -64,8 +64,7 @@ else
|
||||
fi
|
||||
|
||||
# Initialize the database if it has not been initialized yet or if data reset/upgrade has been requested.
|
||||
./init-db --reset=${RESET_DB} --upgrade=${UPGRADE_DB} --config=${CONFIG} --data=${SAMPLE_DATA} 2>&1 > /var/log/tinode-init-db.log
|
||||
grep "usr;tino;" /var/log/tinode-init-db.log > /botdata/tino-password
|
||||
./init-db --reset=${RESET_DB} --upgrade=${UPGRADE_DB} --config=${CONFIG} --data=${SAMPLE_DATA} | grep "usr;tino;" > /botdata/tino-password
|
||||
|
||||
if [ -s /botdata/tino-password ] ; then
|
||||
# Convert Tino's authentication credentials into a cookie file.
|
||||
@ -76,11 +75,11 @@ if [ -s /botdata/tino-password ] ; then
|
||||
./credentials.sh /botdata/.tn-cookie < /botdata/tino-password
|
||||
fi
|
||||
|
||||
args=("--config=${CONFIG}" "--static_data=$STATIC_DIR" "2>&1")
|
||||
args=("--config=${CONFIG}" "--static_data=$STATIC_DIR")
|
||||
|
||||
# Maybe set node name in the cluster.
|
||||
if [ ! -z "$CLUSTER_SELF" ] ; then
|
||||
args+=("--cluster_self=$CLUSTER_SELF")
|
||||
fi
|
||||
# Run the tinode server.
|
||||
./tinode "${args[@]}"
|
||||
./tinode "${args[@]}" 2> /var/log/tinode.log
|
||||
|
15
docs/faq.md
15
docs/faq.md
@ -1,15 +1,18 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
### Q: Where can I find server logs when running in Docker?<br/>
|
||||
**A**: The logs are written to container's stdout. To view the logs, run
|
||||
**A**: The log is in the container at `/var/log/tinode.log`. Attach to a running container with command
|
||||
```
|
||||
docker logs name-of-the-running-container
|
||||
docker exec -it name-of-the-running-container /bin/bash
|
||||
```
|
||||
Then, for instance, see the log with `tail -50 /var/log/tinode.log`
|
||||
|
||||
If the container has stopped already, you can copy the log out of the container (saving it to `./tinode.log`):
|
||||
```
|
||||
docker cp name-of-the-container:/var/log/tinode.log ./tinode.log
|
||||
```
|
||||
|
||||
Alternatively, you can access the log file on the host machine at
|
||||
```
|
||||
/var/lib/docker/containers/<container id>/<container id>-json.log
|
||||
```
|
||||
Alternatively, you can instruct the docker container to save the logs to a directory on the host by mapping a host directory to `/var/log/` in the container. Add `-v /where/to/save/logs:/var/log` to the `docker run` command.
|
||||
|
||||
### Q: How to setup FCM push notifications?<br/>
|
||||
**A**: If you running the server directly:
|
||||
|
Reference in New Issue
Block a user