Search code examples
jsonloggingjbosswildfly

Disable wildfly boot logs


=========================================================================


JBoss Bootstrap Environment


JBOSS_HOME: /opt/jboss/wildfly


JAVA: /usr/lib/jvm/java/bin/java


JAVA_OPTS: -server -Xms1024m -Xmx2048m Djava.net.preferIPv4Stack=true -server -Djava.awt.headless=false -DnmsServer=true -Djava.naming.factory.initial=org.jboss.as.naming.InitialContextFactory


=========================================================================

At the start of the wildfly server, we can see those kinds of logs printed by I believe standalone.sh script

I have a requirement that all stdout logs should be in JSON format. All other logs except those printed by sh scripts are configured in standalone.xml and work fine as JSON. Is that possible somehow to configure those boot logs (Without touching sh scripts) or maybe remove them entirely?


Solution

  • In standalone.sh (starting at line 321 in at least Wildfly 24.0.1) there is:

    # Display our environment
    echo "========================================================================="
    echo ""
    echo "  JBoss Bootstrap Environment"
    echo ""
    echo "  JBOSS_HOME: $JBOSS_HOME"
    echo ""
    echo "  JAVA: $JAVA"
    echo ""
    echo "  JAVA_OPTS: $JAVA_OPTS"
    echo ""
    echo "========================================================================="
    echo ""
    

    If you can't modify the default standalone.sh then you'll need to make a copy of it and remove this. Note that there are other echo statements in the file in the case of an error.