<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://jetty.org/configure_10_0.dtd">

<Configure id="logging">
  <New id="ServerLog" class="java.io.PrintStream">
    <Arg>
      <New class="org.eclipse.jetty.util.RolloverFileOutputStream">
        <Arg><Property name="jetty.console-capture.dir" default="./logs" />/yyyy_mm_dd.jetty.log
        </Arg>
        <Arg type="boolean">
          <Property name="jetty.console-capture.append" default="false" />
        </Arg>
        <Arg type="int">
          <Property name="jetty.console-capture.retainDays" default="90" />
        </Arg>
        <Arg>
          <Call class="java.util.TimeZone" name="getTimeZone">
            <Arg>
              <Property name="jetty.console-capture.timezone" default="GMT" />
            </Arg>
          </Call>
        </Arg>
        <Get id="ServerLogName" name="datedFilename" />
      </New>
    </Arg>
  </New>

  <Call class="org.slf4j.LoggerFactory" name="getLogger">
    <Arg>org.eclipse.jetty</Arg>
    <Call name="info">
      <Arg>Console stderr/stdout captured to
        <Ref refid="ServerLogName" />
      </Arg>
    </Call>
  </Call>
  <Call class="java.lang.System" name="setErr">
    <Arg>
      <Ref refid="ServerLog" />
    </Arg>
  </Call>
  <Call class="java.lang.System" name="setOut">
    <Arg>
      <Ref refid="ServerLog" />
    </Arg>
  </Call>
</Configure>
