docker - Where does dockerized jetty store its logs? -
i'm packaging project docker jetty image , i'm trying access logs, no logs.
dockerfile
from jetty:9.2.10 maintainer me "me@me.com" add ./target/abc-1.0.0 /var/lib/jetty/webapps/root expose 8080
bash script start docker image:
docker pull me/abc docker stop abc docker rm abc docker run --name='abc' -d -p 10908:8080 -v /var/log/abc:/var/log/jetty me/abc:latest
the image running, i'm not seeing jetty logs in /var/log
.
i've tried docker run -it jetty bash
, not seeing jetty logs in /var/log
either.
am missing parameter make jetty output logs or output somewhere other /var/log/jetty
?
why aren't seeing logs
2 things note:
running
docker run -it jetty bash
start new container instead of connecting existing daemonized container.and invoke bash instead of starting jetty in container, won't logs either container.
so interactive container won't in case.
but also...
jettylogs disabled anyways
also, won't see logs in standard location (say, if tried use docker exec
read logs, or them in volume), quite because jetty docker file aptly disabling logging entirely.
if @ jetty:9.2.10 dockerfile, see line:
&& sed -i '/jetty-logging/d' etc/jetty.conf \
which nicely removes entire line referencing jetty-logging.xml default logging configuration.
what then?
reading logs docker logs
docker gives access container's standard output.
after did this:
docker run --name='abc' -d -p 10908:8080 -v /var/log/abc:/var/log/jetty me/abc:latest
you can this:
docker logs abc
and greeted somethig similar this:
running jetty: 2015-05-15 13:33:00.729:info::main: logging initialized @2295ms 2015-05-15 13:33:02.035:info:oejs.setuidlistener:main: setting umask=02 2015-05-15 13:33:02.102:info:oejs.setuidlistener:main: opened serverconnector@73ec519{http/1.1}{0.0.0.0:8080} 2015-05-15 13:33:02.102:info:oejs.setuidlistener:main: setting gid=999 2015-05-15 13:33:02.106:info:oejs.setuidlistener:main: setting uid=999 2015-05-15 13:33:02.133:info:oejs.server:main: jetty-9.2.10.v20150310 2015-05-15 13:33:02.170:info:oejdp.scanningappprovider:main: deployment monitor [file:/var/lib/jetty/webapps/] @ interval 1 2015-05-15 13:33:02.218:info:oejs.serverconnector:main: started serverconnector@73ec519{http/1.1}{0.0.0.0:8080} 2015-05-15 13:33:02.219:info:oejs.server:main: started @3785ms
use docker logs
more details.
customize
obviously other option revert default dockerfile jetty doing, or create own dockerized jetty.
Comments
Post a Comment