315748 made --daemon log non appendable
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1930 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
cf039140fb
commit
fe6a6e86ed
|
@ -177,7 +177,10 @@ public class Main
|
|||
// Special internal indicator that jetty was started by the jetty.sh Daemon
|
||||
if ("--daemon".equals(arg))
|
||||
{
|
||||
File startLog = new File(System.getProperty("jetty.logs","."),"start.log");
|
||||
File startDir = new File(System.getProperty("jetty.logs","logs"));
|
||||
if (!startDir.exists() || !startDir.canWrite() )
|
||||
startDir = new File(".");
|
||||
File startLog = new File(startDir,"start.log");
|
||||
if (!startLog.exists() && !startLog.createNewFile())
|
||||
{
|
||||
// Output about error is lost in majority of cases.
|
||||
|
@ -193,7 +196,7 @@ public class Main
|
|||
// Toss a unique exit code indicating this failure.
|
||||
System.exit(ERR_LOGGING);
|
||||
}
|
||||
PrintStream logger = new PrintStream(new FileOutputStream(startLog,true));
|
||||
PrintStream logger = new PrintStream(new FileOutputStream(startLog,false));
|
||||
System.setOut(logger);
|
||||
System.setErr(logger);
|
||||
System.out.println("Establishing start.log on " + new Date());
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</Arg>
|
||||
</New>
|
||||
|
||||
<Call class="org.eclipse.jetty.util.log.Log" name="debug"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
|
||||
<Call class="org.eclipse.jetty.util.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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue