This is a tiny (~ 5kB) Java Servlet enabling easy downloading of Apache Tomcat logfiles via http, e.g. from a Tomcat inside a container.
- It sends a zip called file
logs.zip
containing all files in${catalina.base}/logs
, including subdirectories, to any client requesting its context path (/logs
by default). - The zip file is streamed directly to the client. This make this program memory friendly.
- It is built for trusted environments, i.e. performs no authentication. If you have secrets in your logfiles, don't use this
- Zero configuration
- Zero external dependencies
It originally was built to easily get logs out of tomcat running in a docker container, and to form a more informed opinion on Gradle vs Maven.
- Gradle (tested with 2.4) or Maven (tested with 3.3.3)
- Run
gradle war
to build. The resulting file isbuild/lib/logs.war
and can be dropped right into your webapps directory. - To deploy via tomcat manager, run
gradle -Pcargo.username=<username> -Pcargo.password=<password> -Pcargo.hostname=<hostname> -Pcargo.port=<port> cargoRedeployRemote
- Maven: run
mvn package
to build. The resulting file istarget/logs.war
and can be dropped right into your webapps directory. - To deploy via tomcat manager, run
mvn tomcat7:redeploy -Dmaven.tomcat.url=http://<host>:<port>/manager/text -Dtomcat.username=<password>-Dtomcat.password=<password>