LOGPATH= Path to search any log file with extension .log ie ( LOGPATH=/var/log) Inside port: 8080
-
- docker docker pull javiercalles/wtee
For testing : create dir test and file test.log like this:
mkdir test && touch test/test.log
docker run --rm -it --name=testlogs -v "$(pwd)/test:/test" -p 8080:8080 -e "LOGPATH=/test" javiercalles/wtee
-
- run this command:
while true; do sleep 2;echo "test logs in
bash test-script.sh
* 4) put in your brower
* http://localhost:8080/
### docker-compose
```yml
version: '3'
services:
applications:
image: tianon/true
volumes:
- "./data/logs:/var/log/nginx"
logs:
image: javiercalles/wtee
tty: true
ports:
- "8080:8080"
volumes:
- "./data/logs:/var/log"
environment:
- LOGPATH=/var/log/nginx
apache:
image: nginx
tty: true
ports:
- "8081:80"
volumes_from:
- applications
if you need to get logs from running container, and container has volumes exposed, run this:
docker run --rm -it --name testlogs --link <CONTAINERNAME/ID> --network CONTAINERNETWORK -p PORT:8080 --volumes-from CONTAINERNAME/ID javiercalles/wtee sh