Skip to content

Direct java service output to console when running in docker #2337

@terrywbrady

Description

@terrywbrady

log4j2.xml

Provide a docker alternative file

Per Google AI

Log4j's default initialization process attempts to find a configuration file (e.g., log4j.properties or log4j2.xml) on the classpath.
You can override this default behavior and explicitly specify the location of your configuration file using the log4j.configuration (for Log4j 1.x) or log4j.configurationFile (for Log4j 2.x) Java system property when launching your application.
Example: java -Dlog4j.configurationFile=path/to/my-log4j2.xml MyApplication

Access logs

Per Google AI...

Modify server.xml

    <Host name="localhost" appBase="webapps"
          unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="/dev"
               prefix="stdout"
               suffix=""
               pattern="%h %l %u %t &quot;%r&quot; %s %b"
               buffered="false"
               fileDateFormat="" />

        <!-- Other configurations for your Host -->

    </Host>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions