diff --git a/Dockerfile b/Dockerfile index 0ec265f..7813732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,11 @@ ARG SERVER_XML=server.xml ARG LOGGING_PROPERTIES=logging.properties ARG CATALINA_PROPERTIES=catalina.properties ARG TOMCAT_MAJOR=9 + +# As provided here, only the access log gets written to this location. +# Mount to a persistant volume to preserve access logs. +# Modify this value to specify a different log directory. +# e.g. /home/logs in Azure App Service ENV LOG_ROOT=/tomcat_logs ENV PATH /usr/local/tomcat/bin:$PATH diff --git a/logging.properties b/logging.properties index a1b856d..a9ed260 100644 --- a/logging.properties +++ b/logging.properties @@ -14,7 +14,7 @@ # limitations under the License. -# This file has been modified from Tomcat's original to redirect all loging to the console. +# This file has been modified from Tomcat's original to redirect all logging to the console. # Console output of containers can be consumed by Azure Monitor and other services. # For more information about enabling Azure Monitor for Containers, see diff --git a/startup.sh b/startup.sh index 5543453..365141c 100644 --- a/startup.sh +++ b/startup.sh @@ -1,5 +1,7 @@ #!/bin/sh +# Create a log directory for each hostname in case a shared file system is used among multiple hosts or containers. +# As provided in the default configuration, only the access log gets written to this directory. LOG_DIR="${LOG_ROOT}/$(hostname)" mkdir -p "${LOG_DIR}" export JAVA_OPTS="${JAVA_OPTS} -Dlog.base=${LOG_DIR}"