[logback-dev] svn commit: r2276 - in logback-demo/trunk: . src/etc src/main/java/ch/qos/logback/demo/login src/main/java/ch/qos/logback/demo/util src/main/webapp/WEB-INF

noreply.ceki at qos.ch noreply.ceki at qos.ch
Thu Jun 11 11:14:16 CEST 2009


Author: ceki
Date: Thu Jun 11 11:14:15 2009
New Revision: 2276

Modified:
   logback-demo/trunk/pom.xml
   logback-demo/trunk/src/etc/jetty.xml
   logback-demo/trunk/src/etc/logback-access.xml
   logback-demo/trunk/src/main/java/ch/qos/logback/demo/login/LoginAction.java
   logback-demo/trunk/src/main/java/ch/qos/logback/demo/util/EnhancedStatusPrinter.java
   logback-demo/trunk/src/main/webapp/WEB-INF/web.xml

Log:
- ongoing improvements

Modified: logback-demo/trunk/pom.xml
==============================================================================
--- logback-demo/trunk/pom.xml	(original)
+++ logback-demo/trunk/pom.xml	Thu Jun 11 11:14:15 2009
@@ -9,7 +9,7 @@
   <version>1.0</version>
 
   <properties>
-    <lb.version>0.9.14-SNAPSHOT</lb.version>
+    <lb.version>0.9.15-SNAPSHOT</lb.version>
   </properties>
 
 
@@ -44,11 +44,24 @@
     </dependency>
 
     <dependency>
+      <groupId>janino</groupId>
+      <artifactId>janino</artifactId>
+      <version>2.4.3</version>
+    </dependency>
+
+    <dependency>
     	<groupId>ch.qos.logback</groupId>
     	<artifactId>logback-access</artifactId>
       <version>${lb.version}</version>
     	<scope>provided</scope>
     </dependency>
+
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-core</artifactId>
+      <version>${lb.version}</version>
+    	<scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -67,31 +80,36 @@
       	<groupId>org.mortbay.jetty</groupId>
       	<artifactId>maven-jetty-plugin</artifactId>
         <!-- Plugin version == server version -->
-        <version>6.1.1</version>
+        <version>6.1.12</version>        
       	<configuration>
       		<scanIntervalSeconds>0</scanIntervalSeconds>
       		<jettyConfig>${basedir}/src/etc/jetty.xml</jettyConfig>
       	  <!-- <jettyConfig>src/etc/jetty-jmx.xml</jettyConfig> -->
+          
       	</configuration>
       	<dependencies>
       		<dependency>
       			<groupId>ch.qos.logback</groupId>
       			<artifactId>logback-access</artifactId>
             <version>${lb.version}</version>
-      			<scope>runtime</scope>
       		</dependency>
       		<dependency>
       			<groupId>ch.qos.logback</groupId>
       			<artifactId>logback-core</artifactId>
      				<version>${lb.version}</version>
-      			<scope>runtime</scope>
       		</dependency>
       		<dependency>
       			<groupId>janino</groupId>
       			<artifactId>janino</artifactId>
       			<version>2.4.3</version>
-      			<scope>runtime</scope>
       		</dependency>
+
+          <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-tools</artifactId>
+            <version>3.0.1</version>
+          </dependency>
+
       	</dependencies>
       </plugin>
 

Modified: logback-demo/trunk/src/etc/jetty.xml
==============================================================================
--- logback-demo/trunk/src/etc/jetty.xml	(original)
+++ logback-demo/trunk/src/etc/jetty.xml	Thu Jun 11 11:14:15 2009
@@ -30,7 +30,7 @@
     <Call name="addConnector">
       <Arg>
           <New class="org.mortbay.jetty.nio.SelectChannelConnector">
-            <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
+            <Set name="port"><SystemProperty name="jetty.port" default="8070"/></Set>
             <Set name="maxIdleTime">30000</Set>
             <Set name="Acceptors">2</Set>
             <Set name="confidentialPort">8443</Set>
@@ -69,7 +69,7 @@
         <Arg>
           <New class="org.mortbay.management.MBeanContainer">
             <Arg><Ref id="MBeanServer"/></Arg>
-            <Set name="managementPort">8082</Set>
+            <Set name="managementPort">8072</Set>
             <Call name="start" />
           </New>
         </Arg>

Modified: logback-demo/trunk/src/etc/logback-access.xml
==============================================================================
--- logback-demo/trunk/src/etc/logback-access.xml	(original)
+++ logback-demo/trunk/src/etc/logback-access.xml	Thu Jun 11 11:14:15 2009
@@ -48,7 +48,7 @@
     <To>another.email at yourOrg.com</To>     		
 	</appender>
 	-->
-	
+	 
 	
 	<!-- Part JMX 
   <filter class="ch.qos.logback.access.filter.CountingFilter">
@@ -56,6 +56,30 @@
 	</filter>	
 	-->
 
+  <appender name="SIFTING" class="ch.qos.logback.access.sift.SiftingAppender">
+    <Discriminator class="ch.qos.logback.access.sift.AccessEventDiscriminator">
+      <Key>id</Key>
+      <DefaultValue>NA</DefaultValue>
+      <!-- 
+      <FieldName>COOKIE</FieldName>
+      <AdditionalKey>JSESSIONID</AdditionalKey>
+      -->
+      <FieldName>REQUEST_ATTRIBUTE</FieldName>
+      <AdditionalKey>a</AdditionalKey>
+
+    </Discriminator>
+    <sift>
+       <appender name="${id}" class="ch.qos.logback.core.FileAppender">
+        <File>session/${id}.log</File>
+        <layout class="ch.qos.logback.access.PatternLayout">
+          <Pattern>%h %l %u %t \"%r\" %s %b</Pattern>
+        </layout>
+      </appender>
+    </sift>
+  </appender>
+
+  <appender-ref ref="SIFTING" />
+
   <!--  
   <appender-ref ref="STDOUT" />
   -->

Modified: logback-demo/trunk/src/main/java/ch/qos/logback/demo/login/LoginAction.java
==============================================================================
--- logback-demo/trunk/src/main/java/ch/qos/logback/demo/login/LoginAction.java	(original)
+++ logback-demo/trunk/src/main/java/ch/qos/logback/demo/login/LoginAction.java	Thu Jun 11 11:14:15 2009
@@ -29,9 +29,11 @@
         MDC.put(Constants.USER, username);
         logger.info("Login: " + username + " just logged in.");
         request.getSession().setAttribute(Constants.USER, username);
+        request.setAttribute("a", username);
       }
     }
 
+    System.out.println("xxxxxxxxxxxxxxx");
     return actionMapping.findForward("next");
 
   }

Modified: logback-demo/trunk/src/main/java/ch/qos/logback/demo/util/EnhancedStatusPrinter.java
==============================================================================
--- logback-demo/trunk/src/main/java/ch/qos/logback/demo/util/EnhancedStatusPrinter.java	(original)
+++ logback-demo/trunk/src/main/java/ch/qos/logback/demo/util/EnhancedStatusPrinter.java	Thu Jun 11 11:14:15 2009
@@ -50,9 +50,7 @@
   public static void print(StringBuffer buf, StatusManager sm) {
 
     List<Status> statusList = sm.getCopyOfStatusList();
-    Iterator it = statusList.iterator();
-    while (it.hasNext()) {
-      Status s = (Status) it.next();
+    for (Status s: statusList) {
       print(buf, "", s);
     }
   }

Modified: logback-demo/trunk/src/main/webapp/WEB-INF/web.xml
==============================================================================
--- logback-demo/trunk/src/main/webapp/WEB-INF/web.xml	(original)
+++ logback-demo/trunk/src/main/webapp/WEB-INF/web.xml	Thu Jun 11 11:14:15 2009
@@ -94,10 +94,30 @@
     <servlet-class>ch.qos.logback.demo.ViewLastLog</servlet-class>
   </servlet>
 
+  <servlet>
+    <servlet-name>ViewStatusMessages</servlet-name>
+    <servlet-class>ch.qos.logback.classic.ViewStatusMessagesServlet</servlet-class>
+  </servlet>
+
+  <servlet>
+    <servlet-name>AccessViewStatusMessages</servlet-name>
+    <servlet-class>ch.qos.logback.access.ViewStatusMessagesServlet</servlet-class>
+  </servlet>
+    
   <servlet-mapping>
     <servlet-name>ViewLastLog</servlet-name>
     <url-pattern>/lastLog/*</url-pattern>
   </servlet-mapping>
-    
+ 
+  <servlet-mapping>
+    <servlet-name>ViewStatusMessages</servlet-name>
+    <url-pattern>/lbClassicStatus</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>AccessViewStatusMessages</servlet-name>
+    <url-pattern>/lbAccessStatus</url-pattern>
+  </servlet-mapping>
+       
 </web-app>
 


More information about the logback-dev mailing list