Skip to content

Proxy application logs are discarded when CATALINA_OUT is /dev/null #12

Description

@jvendetti

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:

CATALINA_OUT=/dev/null

... 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions