Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is possible to redirect all output sent to stderr and stdout to a file that
can be rolled over. This can be configured in jetty.xml as follows:

Code Block
    
    <New id="ServerLog" class="java.io.PrintStream">
      <Arg>
        <New class="org.mortbay.util.RolloverFileOutputStream">
      <Arg><Property    <Arg><SystemProperty name="hamachijetty.home" default="."/>/<Property name="hamachi.node" default="i2"/>/log/logs/yyyy_mm_dd.serverstderrout.log</Arg>
          <Arg type="boolean">true</Arg><!--append-->>false</Arg>
          <Arg type="int">90</Arg><!--retain days-->Arg>
          <Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
          <Get id="ServerLogName" name="datedFilename"/>
        </New>
      </Arg>
    </New>

    <Call class="org.mortbay.log.Log" name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
    <Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call>
    <Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call>

this config is now available in a mixin configuration file so you can include it by starting jetty with:

Code Block
    java -jar start.jar etc/jetty-logging.xml etc/jetty.xml
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery