Something we’ve been lobbying for is the ability to push Lucee logs to syslog or equivalent. At the moment you need an agent/sidecar/something to process the text logs into a log drain and pipe to somewhere. For now streaming logs from multiple lucee containers into cloudwatch is non-trivial.
Dumb question (since I haven’t looked at it), isn’t that the point of LOG4J Appenders? That you can set one for lucee and that would be a Tomcat Appender (or something like that?)
OK I have aded a simlink to the internal logger… I am testing now…
This was added to my docker file–>
RUN cd /opt/lucee/server/lucee-server/context/logs && ( for i in ls *.log; do ln -sf /proc/1/fd/1 $i ; done ) && cd /opt/lucee/web/logs && ( for i in echo application.log exception.log gateway.log mail.log remoteclient.log requesttimeout.log scheduler.log scope.log trace.log; do ln -sf /proc/1/fd/1 $i ; done )
FROM lucee/lucee:5.3-nginx
# FROM lucee/lucee:5.3.4.80-nginx-tomcat9.0-jdk11-openjdk
# NGINX configs
COPY app/config/nginx/ /etc/nginx/
# Patch Server
# COPY patches/ /opt/lucee/server/lucee-server/patches/
# Lucee configs
# COPY config/lucee/ /opt/lucee/web/
# Code
# remove hg it has a security vulnerability
run apt-get update -y
run apt-get remove --auto-remove mercurial -y
run apt-get purge mercurial -y
run apt-get install awscli -y
run sed -i 's/<cfLuceeConfiguration.*>/<cfLuceeConfiguration hspw="1e4ff17304e0a1c6baa8f5d8057ffedd61f6f7aa6500e5fae27c6cfed833b518" salt="4FDA588E-318A-445C-898736AA1F229A69" version="5.2">/g' /opt/lucee/server/lucee-server/context/lucee-server.xml
run sed -i 's/<cfLuceeConfiguration.*>/<cfLuceeConfiguration hspw="1e4ff17304e0a1c6baa8f5d8057ffedd61f6f7aa6500e5fae27c6cfed833b518" salt="4FDA588E-318A-445C-898736AA1F229A69" version="5.2">/g' /opt/lucee/web/lucee-web.xml.cfm
run ls -la
ADD app/www /var/www
run ls -la /var/www
RUN cd /opt/lucee/server/lucee-server/context/logs && ( for i in `ls *.log`; do ln -sf /proc/1/fd/1 $i ; done ) && cd /opt/lucee/web/logs && ( for i in `echo application.log exception.log gateway.log mail.log remoteclient.log requesttimeout.log scheduler.log scope.log trace.log`; do ln -sf /proc/1/fd/1 $i ; done )
One would think that who ever is building the Docker container would adjust the logging to support containers. Also they need to use openjdk11 and not the Oracle Java… Better yet used openjdk11 on alpine. The container is too large… Meaning startup/autoscaling response times will be slow.
In containers i don’t want any text logs written – they just get destroyed when the container redeploys. It would be super sweet if Lucee would just stream all Lucee logs to syslog. And had a defined template with examples of how to restructure the logs if needed.
There’s an option to set a datasource as a destination; seems like a small jump to having other useful choices.
With respect to Tomcat Alpine… that was part of our build matrix until Tomcat support was dropped for Alpine on account of OpenJDK compatibility issues:
Note: The official Tomcat images have removed support for Alpine and so the Lucee -alpine variant can no longer be supported. If the Tomcat base images add support for Alpine in the future then we will look to support the -alpine variant again.
Tomcat project said:
Alpine/musl is not officially supported by the OpenJDK project, so this reflects that – see “Project Portola” for the Alpine porting efforts which I understand are still in need of help
If that changes… let us know and we’ll reinstate Alpine as an option.
Alpine is since it not supported by Tomcat. I’ll stick with lucee/lucee:5.3-nginx version for now. Working though the DSN issues and Mail service issues. I think I can a fix for the logging issues. Now I need to fix the Security issues. Looks like if I remove the python 2.7/3.7 or update this might fix the 2 highs. The journey continues… The goal is to use lucee to build a 12 factor app using Fargate on AWS.