Ticket #13089: 0001-Nicer-logging-configuration.-Version-independent-war.patch

File 0001-Nicer-logging-configuration.-Version-independent-war.patch, 3.2 KB (added by iwakeh, 5 years ago)

based on ​your task-13089 branch

  • build.xml

    From 3f2ade826aa2908666a71790e5aa6a4ba0b54d9b Tue Sep 30 22:30:00 2014
    From: iwakeh <iwakeh@users.ourproject.org>
    Date: Tue, 30 Sep 2014 22:30:00 +0000
    Subject: [PATCH] Nicer logging configuration. Version independent war
     start-up. Removed obsolete run task.
    
    ---
     build.xml     | 20 ++++++--------------
     etc/jetty.xml |  6 +++++-
     logback.xml   |  4 +++-
     3 files changed, 14 insertions(+), 16 deletions(-)
    
    diff --git a/build.xml b/build.xml
    index e41c7b9..66983ba 100644
    a b  
    109109
    110110  <target name="war"
    111111          depends="compile">
    112     <copy file="logback.xml" todir="${classes}" />
    113     <copy file="logback.xml" todir="${config}" />
    114112    <war destfile="${warfile}"
    115113         webxml="${webxmlfile}">
    116114      <fileset dir="web"/>
     
    122120        <include name="commons-compress-1.4.1.jar"/>
    123121        <include name="commons-lang-2.6.jar"/>
    124122        <include name="gson-2.1.jar"/>
    125         <include name="junit4-4.10.jar"/>
    126123        <include name="servlet-api-3.0.jar"/>
    127124        <include name="jetty8-server-8.1.3.v20120416.jar"/>
    128125        <include name="jetty8-servlet-8.1.3.v20120416.jar"/>
     
    138135        <include name="slf4j-api-1.6.5.jar"/>
    139136      </zipgroupfileset>
    140137      <fileset dir="${classes}"
    141                includes="**/*" />
     138               includes="**/*"
     139                excludes="**/Test*.class"/>
    142140      <fileset dir="${config}" includes="jetty.xml" />
    143       <zipfileset dir="${config}"
     141      <zipfileset dir="${basedir}"
     142                  prefix=""
     143                  includes="logback.xml"/>
     144      <zipfileset dir="${basedir}"
    144145                  prefix="WEB-INF/classes"
    145146                  includes="logback.xml"/>
    146147      <metainf dir="${config}"
     
    158159    </war>
    159160  </target>
    160161
    161   <target name="run" depends="compile">
    162     <copy file="logback.xml" todir="${classes}" />
    163     <java fork="true"
    164           maxmemory="${maxmemory.value}"
    165           classname="org.torproject.onionoo.cron.Main">
    166       <classpath refid="classpath"/>
    167     </java>
    168   </target>
    169 
    170162  <target name="releasejar" depends="compile">
    171163    <jar destfile="${jarfile}"
    172164         basedir="${classes}">
  • etc/jetty.xml

    diff --git a/etc/jetty.xml b/etc/jetty.xml
    index 0c4ae98..4dbf7e6 100644
    a b  
    1515
    1616  <New id="onionoo" class="org.eclipse.jetty.webapp.WebAppContext">
    1717    <Set name="logUrlOnStart">true</Set>
    18     <Set name="war">onionoo-1.1.1.war</Set>
     18    <Set name="war">
     19      <Call class="java.lang.System" name="getProperty">
     20        <Arg>java.class.path</Arg>
     21      </Call>
     22    </Set>
    1923  </New>
    2024
    2125  <Call name="addConnector">
  • logback.xml

    diff --git a/logback.xml b/logback.xml
    index fd11f04..ac41b64 100644
    a b  
    11<configuration debug="false">
    22
    33  <!-- a path and a prefix -->
    4   <property name="logfile-base" value="./onionoo-" />
     4  <property name="logfile-base" value="${LOGBASE}/onionoo-" />
    55
    66  <!-- log file names -->
    77  <property name="fileall-logname" value="${logfile-base}all" />
     
    6060    <appender-ref ref="FILEERR" />
    6161  </logger>
    6262
     63  <logger name="org.eclipse" level="INFO" />
     64
    6365  <logger name="org.torproject.onionoo.cron.Main" >
    6466    <appender-ref ref="FILESTATISTICS" />
    6567  </logger>