Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1604

Log4j2 TcpSocketServer in background

    Details

    • Type: Question
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Linux geotst01 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      Description

      I've been using the log4j version 1 SocketServer in background without problem. Changing to the TcpSocketServer works in foreground, but when I put it in the background, it shuts down. I've managed to get it working redirecting input from /dev/zero but as this will give continuous nulls, I'm not sure it's an ideal solution:

      exec $JAVA_HOME/bin/java -cp $LIB_DIR/log4j-api-2.6.2.jar:$LIB_DIR/log4j-core-2.6.2.jar \
      org.apache.logging.log4j.core.net.server.TcpSocketServer \
      ${LOGPORT} ${BASEDIR}/etc/log4j2.xml </dev/zero >/dev/null 2>&1 &

      Is the code intended to be used in background and, if yes what's the recommended way to launch TcpSocketServer? Could a parameter be added to make it a daemon not needing input?

        Attachments

          Activity

            People

            • Assignee:
              garydgregory Gary Gregory
              Reporter:
              colinh Colin Hillman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: