Problem
The sifr-bioportal-annotator-proxy servlet logs useful runtime information through SLF4J/Log4j, but the current Log4j setup only writes to a ConsoleAppender.
The relevant configuration is effectively:
log4j.rootLogger=info, STDERR
log4j.appender.STDERR=org.apache.log4j.ConsoleAppender
Despite the appender name STDERR, this is console output, not a dedicated application log file.
On servers where Tomcat is configured with:
... the proxy's application logs are discarded. Tomcat still writes container exceptions to files such as localhost.YYYY_MM_DD.log, but the app's own contextual logs are unavailable.
Impact
When the servlet fails, we may only see a Tomcat stack trace, without the proxy logs that would explain what happened.
For example, AnnotatorServlet logs the upstream annotator response before parsing it:
logger.info("Query output: {}", queryOutput);
... but that output is lost when console output is redirected to /dev/null.
This makes production incidents difficult to diagnose, especially when the upstream annotator returns invalid JSON, HTML, plaintext, or an empty response.
Expected behavior
The proxy should write application logs to a durable location independent of catalina.out.
Proposed fix
Add an explicit Log4j file or rolling-file appender for the proxy WAR, ideally configured under ${catalina.base}/logs.
For example, write proxy logs to something like:
${catalina.base}/logs/annotatorplus.log
or a date-rolling equivalent.
Acceptance criteria
- Proxy application logs are written to a dedicated file.
- Logs are still available when
CATALINA_OUT=/dev/null.
- The log file includes servlet request handling errors and upstream annotator response status.
- Documentation notes where production logs are expected to appear.
Problem
The
sifr-bioportal-annotator-proxyservlet logs useful runtime information through SLF4J/Log4j, but the current Log4j setup only writes to aConsoleAppender.The relevant configuration is effectively:
Despite the appender name
STDERR, this is console output, not a dedicated application log file.On servers where Tomcat is configured with:
... the proxy's application logs are discarded. Tomcat still writes container exceptions to files such as
localhost.YYYY_MM_DD.log, but the app's own contextual logs are unavailable.Impact
When the servlet fails, we may only see a Tomcat stack trace, without the proxy logs that would explain what happened.
For example,
AnnotatorServletlogs the upstream annotator response before parsing it:... but that output is lost when console output is redirected to
/dev/null.This makes production incidents difficult to diagnose, especially when the upstream annotator returns invalid JSON, HTML, plaintext, or an empty response.
Expected behavior
The proxy should write application logs to a durable location independent of
catalina.out.Proposed fix
Add an explicit Log4j file or rolling-file appender for the proxy WAR, ideally configured under ${catalina.base}/logs.
For example, write proxy logs to something like:
or a date-rolling equivalent.
Acceptance criteria
CATALINA_OUT=/dev/null.