No logs written
khba opened this issue · comments
Hello,
Me again
Plugin installed and enabled:
$ docker plugin ls
ID NAME DESCRIPTION ENABLED
596ec0fa58a2 docker-log-driver-test:latest jsonfilelog as plugin true
Container is using it:
$ docker inspect 30a4dfdbdcc0 | grep -i log
"LogPath": "",
"LogConfig": {
"Type": "docker-log-driver-test",
Container is receiving requests and producing logs:
$ docker logs 30a4dfdbdcc0 -f
- Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
10.255.0.2 - - [16/Apr/2018 12:23:16] "GET / HTTP/1.1" 200 -
10.255.0.2 - - [16/Apr/2018 12:25:23] "GET / HTTP/1.1" 200 -
10.255.0.2 - - [16/Apr/2018 12:25:25] "GET / HTTP/1.1" 200 -
10.255.0.2 - - [16/Apr/2018 12:29:30] "GET / HTTP/1.1" 200 -
But logs are not being written in /var/log/docker/ as defined in the driver.go code:
if logCtx.LogPath == "" {
logCtx.LogPath = filepath.Join("/var/log/docker", logCtx.ContainerID)
}
I checked the folder permissions and even "chmod"ed it to 777 to test but no logs are being written.
Also no logs from the plugin to help debug why it's not writing the container's logs.
Conclusion: The container logs are not written in the old/default location anymore and not written in the new location either: where are the logs then?
$ docker version
Client:
Version: 18.02.0-ce
API version: 1.36
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:16:33 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.02.0-ce
API version: 1.36 (minimum version 1.12)
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:15:05 2018
OS/Arch: linux/amd64
Experimental: false
Thanks,
The logs would exist inside the plugin container in this case under /var/lib/docker/plugins/<id>/rootfs/var/log/docker/<container id>