Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Forked Jetty: complete logging?

I've got this problem with starting a forked jetty using the
jetty-maven-plugin.  The problem only occurs when done by a Jenkins job. 
When we execute the Maven command manually (on a server or local machine) we
cannot reproduce the problem because the forked jetty simply works.

This Jenkins job uses the same settings, environments, commands as when we
run the job manually using Maven3.

I adjusted the logging by configuring it in a jetty.xml file, but when the
server isn't working because of the Jenkins run there's only a very small
entry in the log files which tells us absolutely nothing.  I want to know
why the server isn't getting up, preferably by decent logging.
When we start the job in Jenkins but *don't use* a forked jetty there is no
problem...  

Jetty.xml:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC &quot;-//Jetty//Configure//EN&quot;
&quot;http://www.eclipse.org/jetty/configure.dtd&quot;>
<Configure class="org.eclipse.jetty.server.Server">
    <Call name="addConnector">
        <Arg>
            <New
class="org.eclipse.jetty.server.nio.SelectChannelConnector">
                <Set name="port">8282</Set>
                <Set name="confidentialPort">1123</Set>
                <Set name="integralPort">1124</Set>
            </New>
        </Arg>
    </Call>

    <New id="ServerLog" class="java.io.PrintStream">
        <Arg>
            <New class="org.eclipse.jetty.util.RolloverFileOutputStream">
                <Arg><SystemProperty name="jetty.home"
default="/"/>/tmp/logs/yyyy_mm_dd.jetty-server.log</Arg>
                <Arg type="boolean">false</Arg>
                <Arg type="int">90</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.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>



    <Set name="handler">
        <New id="Handlers"
class="org.eclipse.jetty.server.handler.HandlerCollection">
            <Set name="handlers">
                <Array type="org.eclipse.jetty.server.Handler">
                    <Item>
                        <New id="Contexts"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
                    </Item>
                    <Item>
                        <New id="DefaultHandler"
class="org.eclipse.jetty.server.handler.DefaultHandler"/>
                    </Item>
                    <Item>
                        <New id="RequestLog"
class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
                    </Item>
                </Array>
            </Set>
        </New>
    </Set>
    <Ref id="RequestLog">
        <Set name="requestLog">
            <New id="RequestLogImpl"
class="org.eclipse.jetty.server.NCSARequestLog">
                <Arg><SystemProperty name="jetty.logs"
default="/"/>/tmp/logs/yyyy_mm_dd.jetty-request.log</Arg>
                <Set name="retainDays">90</Set>
                <Set name="append">true</Set>
                <Set name="extended">true</Set>
                <Set name="LogTimeZone">GMT</Set>
            </New>
        </Set>
    </Ref>


</Configure>


pom.xml

                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <version>8.1.5.v20120716</version>
                        <configuration>
                            <stopKey>stopherding</stopKey>
                            <stopPort>${jetty.stopport}</stopPort>
                           
<jettyXml>src/main/resources/env/${env}/jetty.xml</jettyXml>

                            <daemon>true</daemon>
                            <waitForChild>false</waitForChild>
                           
<war>${project.build.directory}/${project.artifactId}-${project.version}.war</war>
                            <jvmArgs>-Denv=${env} -e -X</jvmArgs>
                            <webApp>
                                <contextPath>/bulk-uploader</contextPath>
                            </webApp>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-forked</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>run-forked</goal>
                                </goals>
                                <inherited>true</inherited>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>


Any input is welcome :-)



--
View this message in context: http://jetty.4.n6.nabble.com/Forked-Jetty-complete-logging-tp4959482.html
Sent from the Jetty User mailing list archive at Nabble.com.


Back to the top