logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1412753 [1/2] - in /logging/log4j/log4j2/trunk: ./ flume-ng/ samples/ samples/flume-common/ samples/flume-common/src/ samples/flume-common/src/main/ samples/flume-common/src/main/java/ samples/flume-common/src/main/java/org/ samples/flume-...
Date Fri, 23 Nov 2012 05:11:36 GMT
Author: rgoers
Date: Fri Nov 23 05:11:28 2012
New Revision: 1412753

URL: http://svn.apache.org/viewvc?rev=1412753&view=rev
Log:
Add Flume samples

Added:
    logging/log4j/log4j2/trunk/samples/   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/pom.xml
    logging/log4j/log4j2/trunk/samples/flume-common/src/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/
    logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java   (with props)
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/org/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/org/apache/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/org/apache/logging/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/org/apache/logging/log4j/
    logging/log4j/log4j2/trunk/samples/flume-common/src/test/java/org/apache/logging/log4j/samples/
    logging/log4j/log4j2/trunk/samples/flume-embedded/   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/README.txt
    logging/log4j/log4j2/trunk/samples/flume-embedded/pom.xml
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/flume-conf.properties
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/META-INF/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/index.jsp   (with props)
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/start.jsp
    logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/stop.jsp
    logging/log4j/log4j2/trunk/samples/flume-remote/   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/README.txt
    logging/log4j/log4j2/trunk/samples/flume-remote/pom.xml
    logging/log4j/log4j2/trunk/samples/flume-remote/src/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/flume-conf.properties
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/log4j-remote.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/META-INF/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/applicationContext.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/jboss-classloading.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/jboss-web.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/rest-servlet.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/web.xml   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/index.jsp   (with props)
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/start.jsp
    logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/stop.jsp
    logging/log4j/log4j2/trunk/samples/pom.xml
    logging/log4j/log4j2/trunk/samples/src/
Modified:
    logging/log4j/log4j2/trunk/flume-ng/pom.xml
    logging/log4j/log4j2/trunk/pom.xml

Modified: logging/log4j/log4j2/trunk/flume-ng/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/pom.xml?rev=1412753&r1=1412752&r2=1412753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/pom.xml (original)
+++ logging/log4j/log4j2/trunk/flume-ng/pom.xml Fri Nov 23 05:11:28 2012
@@ -46,10 +46,12 @@
     <dependency>
       <groupId>org.apache.logging.log4j.adapters</groupId>
       <artifactId>log4j-slf4j-impl</artifactId>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j.adapters</groupId>
       <artifactId>log4j-1.2-api</artifactId>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
@@ -59,8 +61,14 @@
     </dependency>
     <dependency>
       <groupId>org.apache.flume</groupId>
+      <artifactId>flume-ng-sdk</artifactId>
+      <version>${flumeVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.flume</groupId>
       <artifactId>flume-ng-core</artifactId>
       <version>${flumeVersion}</version>
+      <optional>true</optional>
       <exclusions>
         <exclusion>
           <groupId>org.slf4j</groupId>
@@ -76,6 +84,7 @@
       <groupId>org.apache.flume</groupId>
       <artifactId>flume-ng-node</artifactId>
       <version>${flumeVersion}</version>
+      <optional>true</optional>
       <exclusions>
         <exclusion>
           <groupId>org.slf4j</groupId>

Modified: logging/log4j/log4j2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/pom.xml?rev=1412753&r1=1412752&r2=1412753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/pom.xml (original)
+++ logging/log4j/log4j2/trunk/pom.xml Fri Nov 23 05:11:28 2012
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
@@ -14,8 +15,7 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j</artifactId>
@@ -101,8 +101,8 @@
     <osgi.symbolicName>org.apache.logging.${project.artifactId}</osgi.symbolicName>
     <osgi.export>org.apache.logging.log4j.*;version=${project.version};-noimport:=true</osgi.export>
     <osgi.import>*</osgi.import>
-    <osgi.dynamicImport />
-    <osgi.private />
+    <osgi.dynamicImport/>
+    <osgi.private/>
     <pmd.plugin.version>2.7.1</pmd.plugin.version>
     <changes.plugin.version>2.8</changes.plugin.version>
     <javadoc.plugin.version>2.9</javadoc.plugin.version>
@@ -111,7 +111,7 @@
     <maven.compile.source>1.5</maven.compile.source>
     <maven.compile.target>1.5</maven.compile.target>
     <docLabel>Site Documentation</docLabel>
-    <projectDir />
+    <projectDir/>
   </properties>
   <pluginRepositories>
     <pluginRepository>
@@ -483,6 +483,7 @@
     <module>jcl-bridge</module>
     <module>flume-ng</module>
     <module>web</module>
+    <module>samples</module>
   </modules>
   <profiles>
     <profile>
@@ -587,4 +588,4 @@
       </modules>
     </profile>
   </profiles>
-</project>
+</project>
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 05:11:28 2012
@@ -0,0 +1,5 @@
+target
+*.iml
+.settings
+.classpath
+.project

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 05:11:28 2012
@@ -0,0 +1,5 @@
+target
+*.iml
+.settings
+.classpath
+.project

Added: logging/log4j/log4j2/trunk/samples/flume-common/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/pom.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/pom.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/pom.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>log4j-samples</artifactId>
+    <groupId>org.apache.logging.log4j.samples</groupId>
+    <version>2.0-beta4-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.logging.log4j.samples</groupId>
+  <artifactId>flume-common</artifactId>
+  <name>flume-common</name>
+  <packaging>jar</packaging>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.ws</groupId>
+      <artifactId>spring-ws-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.3.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,90 @@
+package org.apache.logging.log4j.samples.app;
+
+import org.apache.logging.log4j.EventLogger;
+import org.apache.logging.log4j.message.StructuredDataMessage;
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.Constraint;
+import org.apache.logging.log4j.samples.util.NamingUtils;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ *
+ */
+public class LogEventFactory {
+
+    public static <T> T getEvent(Class<T> intrface) {
+
+        Class<?>[] interfaces = new Class<?>[]{intrface};
+
+        String eventId = NamingUtils.lowerFirst(intrface.getSimpleName());
+        StructuredDataMessage msg = new StructuredDataMessage(eventId, null, "Audit");
+        AuditEvent audit = (AuditEvent) Proxy.newProxyInstance(intrface
+            .getClassLoader(), interfaces, new AuditProxy(msg, intrface));
+
+        return (T) audit;
+    }
+
+    private static class AuditProxy implements InvocationHandler {
+
+        private final StructuredDataMessage msg;
+        private final Class intrface;
+
+        public AuditProxy(StructuredDataMessage msg, Class intrface) {
+            this.msg = msg;
+            this.intrface = intrface;
+        }
+
+        public Object invoke(Object o, Method method, Object[] objects)
+            throws Throwable {
+            if (method.getName().equals("logEvent")) {
+
+                StringBuilder missing = new StringBuilder();
+
+                Method[] methods = intrface.getMethods();
+
+                for (Method _method : methods) {
+                    String name = NamingUtils.lowerFirst(NamingUtils
+                        .getMethodShortName(_method.getName()));
+
+                    Annotation[] annotations = _method.getDeclaredAnnotations();
+                    for (Annotation annotation : annotations) {
+                        Constraint constraint = (Constraint) annotation;
+
+                        if (constraint.required() && msg.get(name) == null) {
+                            if (missing.length() > 0) {
+                                missing.append(", ");
+                            }
+                            missing.append(name);
+                        }
+                    }
+                }
+
+                if (missing.length() > 0) {
+                    throw new IllegalStateException("Event " + msg.getId().getName() +
+                        " is missing required attributes " + missing);
+                }
+                EventLogger.logEvent(msg);
+            }
+            if (method.getName().equals("setCompletionStatus")) {
+                String name = NamingUtils.lowerFirst(NamingUtils.getMethodShortName(method.getName()));
+                msg.put(name, objects[0].toString());
+            }
+            if (method.getName().startsWith("set")) {
+                String name = NamingUtils.lowerFirst(NamingUtils.getMethodShortName(method.getName()));
+
+                /*
+                 * Perform any validation here. Currently the catalog doesn't
+                 * contain any information on validation rules.
+                 */
+                msg.put(name, objects[0].toString());
+            }
+
+            return null;
+        }
+
+    }
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,108 @@
+package org.apache.logging.log4j.samples.app;
+
+import java.util.List;
+import java.util.Random;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.ThreadContext;
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.RequestContext;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+
+/**
+ * The Class LoggingController.
+ */
+@Controller
+public class LoggingController {
+
+    /**
+     * The logger.
+     */
+    private static Logger logger = LogManager.getLogger(LoggingController.class);
+
+    private volatile boolean generateLog = false;
+    private Random ran = new Random();
+
+    private List<AuditEvent> events;
+
+    public LoggingController() {
+
+        ThreadContext.clear();
+
+        RequestContext.setSessionId("session1234");
+        RequestContext.setIpAddress("127.0.0.1");
+        RequestContext.setClientId("02121");
+        RequestContext.setProductName("IB");
+        RequestContext.setProductVersion("4.18.1");
+        RequestContext.setLocale("en_US");
+        RequestContext.setRegion("prod");
+    }
+
+    @RequestMapping(value = "/start.do", method = RequestMethod.GET)
+    public ModelAndView startLogging(
+        @RequestParam(value = "member", required = false, defaultValue = "fakemember") final String member,
+                      HttpServletRequest servletRequest) {
+
+        System.out.println("STARTING..................");
+
+        if (events == null) {
+            events = MockEventsSupplier.getAllEvents(member);
+        }
+
+        generateLog = true;
+
+        (new Thread() {
+
+            public void run() {
+                while (generateLog) {
+                    // Generate rand number between 1 to 10
+                    int rand = ran.nextInt(9) + 1;
+
+                    // Sleep for rand seconds
+                    try {
+                        Thread.sleep(rand * 1000);
+                    } catch (InterruptedException e) {
+                        logger.warn("WARN", e);
+                    }
+
+                    // Write rand number of logs
+                    for (int i = 0; i < rand; i++) {
+                        int eventIndex = (Math.abs(ran.nextInt())) % events.size();
+                        AuditEvent event = events.get(eventIndex);
+                        RequestContext.setUserId(member);
+                        event.logEvent();
+
+                        if ((rand % 4) == 1) {
+                            logger.debug("DEBUG level logging.....");
+                        } else if ((rand % 4) == 2) {
+                            logger.info("INFO level logging.....");
+                        } else if ((rand % 4) == 3) {
+                            logger.warn("WARN level logging.....");
+                        } else {
+                            logger.error("ERROR level logging.....");
+                        }
+                    }
+
+                }
+            }
+        }).start();
+
+        return new ModelAndView("start.jsp");
+    }
+
+    @RequestMapping(value = "/stop.do", method = RequestMethod.GET)
+    public ModelAndView stopLogging(HttpServletRequest servletRequest) {
+        generateLog = false;
+        return new ModelAndView("stop.jsp");
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,82 @@
+package org.apache.logging.log4j.samples.app;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.events.Alert;
+import org.apache.logging.log4j.samples.events.ChangePassword;
+import org.apache.logging.log4j.samples.events.Login;
+import org.apache.logging.log4j.samples.events.ScheduledTransaction;
+import org.apache.logging.log4j.samples.events.Transfer;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+public class MockEventsSupplier {
+
+	/* This provides random generation */
+	static Random ran = new Random();
+
+	public static List<AuditEvent> getAllEvents(String member) {
+
+		List<AuditEvent> events = new ArrayList<AuditEvent>();
+
+
+		Login login = LogEventFactory.getEvent(Login.class);
+		login.setStartPageOption("account summary");
+		login.setSource("online");
+		login.setMember(member);
+		events.add(login);
+
+		ChangePassword changePassword = LogEventFactory.getEvent(ChangePassword.class);
+		changePassword.setMember(member);
+		events.add(changePassword);
+
+		Transfer transfer = LogEventFactory.getEvent(Transfer.class);
+
+		transfer.setAmount("4251");
+		transfer.setFromAccount("REPLACE"); // getAccount(mbr, accounts));
+		transfer.setToAccount("31142553");
+		transfer.setReference("DI-2415220110804");
+		transfer.setComment("My Transfer");
+		transfer.setMemo("For dinner");
+		transfer.setPayment("Use Checking");
+		transfer.setTransactionType("1");
+		transfer.setSource("IB Transfer page");
+		transfer.setCompletionStatus("complete");
+		transfer.setMember(member);
+		events.add(transfer);
+
+		Alert alert = LogEventFactory.getEvent(Alert.class);
+
+		alert.setAction("add");
+		alert.setType("balance alert");
+		alert.setAccountNumber("REPLACE"); // , getAccount(mbr, accounts));
+		alert.setTrigger("GT");
+		alert.setThreshold("1000");
+		alert.setMember(member);
+		events.add(alert);
+
+		ScheduledTransaction scheduledTransaction = LogEventFactory
+				.getEvent(ScheduledTransaction.class);
+
+		scheduledTransaction.setAction("add");
+		scheduledTransaction.setFromAccount("REPLACE"); // getAccount(mbr,
+																										// accounts));
+		scheduledTransaction.setToAccount("REPLACE"); // "9200000214");
+		scheduledTransaction.setAmount("2541");
+		scheduledTransaction.setStartDate("20110105");
+		scheduledTransaction.setMember("256");
+		scheduledTransaction.setFrequency("4");
+		scheduledTransaction.setMemo("Scheduled Transfer");
+		scheduledTransaction.setPayment("3456");
+		scheduledTransaction.setCompletionNotification("Was completed");
+		scheduledTransaction.setEndDate("2020-05-30");
+		scheduledTransaction.setSrtId("Calabasas2341");
+		scheduledTransaction.setSource("Home Page");
+		scheduledTransaction.setCompletionStatus("success");
+		scheduledTransaction.setMember(member);
+		events.add(scheduledTransaction);
+
+		return events;
+	}
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,11 @@
+package org.apache.logging.log4j.samples.dto;
+
+import org.apache.logging.log4j.message.StructuredDataMessage;
+
+/**
+ * Interface that indicates the Class was generated by the DTOManager.
+ */
+public interface AuditEvent {
+
+    void logEvent();
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,21 @@
+package org.apache.logging.log4j.samples.dto;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Constraint {
+
+	boolean required() default false;
+
+	String pattern() default "";
+
+	int minLength() default -1;
+
+	int maxLength() default -1;
+
+	int totalDigits() default -1;
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.samples.dto;
+
+import org.apache.logging.log4j.ThreadContext;
+import org.apache.logging.log4j.core.helpers.UUIDUtil;
+
+/**
+ *
+ */
+public final class RequestContext {
+
+    private RequestContext() {
+    }
+    // Unique token to identify this request.
+    public static final String REQUEST_ID = "id";
+    // Token used to correlate multiple events within the request.
+    public static final String TRANSACTION_ID = "transId";
+    // The requested resource.
+    public static final String REQUEST_URI = "requestURI";
+    // Identify the user's session - should never contain the HTTP SessionId.
+    public static final String SESSION_ID = "sessionId";
+    // The id the user logged in with.
+    public static final String LOGIN_ID = "loginId";
+    // The id the system associates with the user.
+    public static final String USER_ID = "userId";
+    // user, admin, etc.
+    public static final String USER_TYPE = "userType";
+    // client id in a multi-tenant application
+    public static final String CLIENT_ID = "clientId";
+    // The user's ipAddress.
+    public static final String IP_ADDRESS = "ipAddress";
+    // The name of the product.
+    public static final String PRODUCT_NAME = "productName";
+    // The product version.
+    public static final String PRODUCT_VERSION = "productVersion";
+    // The users locale.
+    public static final String LOCALE = "locale";
+    // prod, preprod, beta, dev, etc.
+    public static final String REGION = "region";
+    // The user agent string from the browser.
+    public static final String USER_AGENT = "userAgent";
+
+    public static void initialize() {
+        ThreadContext.clear();
+        ThreadContext.put(REQUEST_ID, UUIDUtil.getTimeBasedUUID().toString());
+    }
+
+    public static String getId() {
+        return ThreadContext.get(REQUEST_ID);
+    }
+
+    public static void setSessionId(String id) {
+        ThreadContext.put(SESSION_ID, id);
+    }
+
+    public static String getSessionId() {
+        return ThreadContext.get(SESSION_ID);
+    }
+
+    public static void setTransId(String id) {
+        ThreadContext.put(TRANSACTION_ID,  id);
+    }
+
+    public static String getTransId() {
+        return ThreadContext.get(TRANSACTION_ID);
+    }
+
+    public static void setRequestURI(String URI) {
+        ThreadContext.put(REQUEST_URI,  URI);
+    }
+
+    public static String getRequestURI() {
+        return ThreadContext.get(REQUEST_URI);
+    }
+
+    public static void setLoginId(String id) {
+        ThreadContext.put(LOGIN_ID,  id);
+    }
+
+    public static String getLoginId() {
+        return ThreadContext.get(LOGIN_ID);
+    }
+
+    public static void setUserId(String id) {
+        ThreadContext.put(USER_ID,  id);
+    }
+
+    public static String getUserId() {
+        return ThreadContext.get(USER_ID);
+    }
+
+    public static void setUserType(String type) {
+        ThreadContext.put(USER_TYPE,  type);
+    }
+
+    public static String getUserType() {
+        return ThreadContext.get(USER_TYPE);
+    }
+
+    public static void setClientId(String id) {
+        ThreadContext.put(CLIENT_ID,  id);
+    }
+
+    public static String getClientId() {
+        return ThreadContext.get(CLIENT_ID);
+    }
+
+    public static void setIpAddress(String addr) {
+        ThreadContext.put(IP_ADDRESS,  addr);
+    }
+
+    public static String getIpAddress() {
+        return ThreadContext.get(IP_ADDRESS);
+    }
+
+    public static void setProductName(String productName) {
+        ThreadContext.put(PRODUCT_NAME, productName);
+    }
+
+    public static String getProductName() {
+        return ThreadContext.get(PRODUCT_NAME);
+    }
+
+
+    public static void setProductVersion(String productVersion) {
+        ThreadContext.put(PRODUCT_VERSION, productVersion);
+    }
+
+    public static String getProductVersion() {
+        return ThreadContext.get(PRODUCT_VERSION);
+    }
+
+    public static void setLocale(String locale) {
+        ThreadContext.put(LOCALE, locale);
+    }
+
+    public static String getLocale() {
+        return ThreadContext.get(LOCALE);
+    }
+
+    public static void setRegion(String region) {
+        ThreadContext.put(REGION, region);
+    }
+
+    public static String getRegion() {
+        return ThreadContext.get(REGION);
+    }
+
+    public static void setUserAgent(String agent) {
+        ThreadContext.put(USER_AGENT, agent);
+    }
+
+    public static String getUserAgent() {
+        return ThreadContext.get(USER_AGENT);
+    }
+
+}

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,62 @@
+package org.apache.logging.log4j.samples.events;
+
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * The user sets up account balance alerts.
+ */
+
+public interface Alert extends org.apache.logging.log4j.samples.dto.AuditEvent {
+
+    /**
+     * Account Number : Account number
+     *
+     * @param accountNumber Account number
+     */
+    @Constraint(required = true)
+    void setAccountNumber(String accountNumber);
+
+    /**
+     * Action : Indicates the step of the registration process.  Valid actions are: Begin, Submit, Enroll Cancel, Confirm Page, Rt In Process Attempt, Reg submitted, acct del, Account del submit, account auto-Select, Duplicate user.  Alternatively, the action the user has executed in the event
+     *
+     * @param action Indicates the step of the registration process.  Valid actions are: Begin, Submit, Enroll Cancel, Confirm Page, Rt In Process Attempt, Reg submitted, acct del, Account del submit, account auto-Select, Duplicate user.  Alternatively, the action the user has executed in the event
+     */
+    void setAction(String action);
+
+    /**
+     * Completion Status : Whether the event succeeded or failed - success/failure and optional reason.
+     *
+     * @param completionStatus Whether the event succeeded or failed - success/failure and optional reason.
+     */
+    void setCompletionStatus(String completionStatus);
+
+    /**
+     * Member : Member or End User number at the Host
+     *
+     * @param member Member or End User number at the Host
+     */
+    @Constraint(required = true)
+    void setMember(String member);
+
+    /**
+     * Threshold : Balance alert, the amount to compare against the balance in the case of a balance alert.  Check cleared alert, there is no value.  for maturity date alert, there is no value.  Loan payment due alert, there is no value.  Loan payment past due alert, there is no value.  Personal reminder and periodic balance alerts, this date is the Start Date that the alert will begin to be sent on.
+     *
+     * @param threshold Balance alert, the amount to compare against the balance in the case of a balance alert.  Check cleared alert, there is no value.  for maturity date alert, there is no value.  Loan payment due alert, there is no value.  Loan payment past due alert, there is no value.  Personal reminder and periodic balance alerts, this date is the Start Date that the alert will begin to be sent on.
+     */
+    void setThreshold(String threshold);
+
+    /**
+     * Trigger : Balance alert, the value is an operator ('GT' for Greater Than or 'LT' for Less Than).  Check alert, this value is the check number.  Maturity date alert, the value is the number of days prior to maturity.  Loan payment due alert, the value is the number of days prior to payment due date.  Loan payment past due alert, there is no value.  Personal reminder and periodic balance alerts, this text is the frequency that the alert will be sent.
+     *
+     * @param trigger Balance alert, the value is an operator ('GT' for Greater Than or 'LT' for Less Than).  Check alert, this value is the check number.  Maturity date alert, the value is the number of days prior to maturity.  Loan payment due alert, the value is the number of days prior to payment due date.  Loan payment past due alert, there is no value.  Personal reminder and periodic balance alerts, this text is the frequency that the alert will be sent.
+     */
+    void setTrigger(String trigger);
+
+    /**
+     * Type : Type of event, bill payment, balance, application, or attribute. For bill pay, type of payment (check, electronic)
+     *
+     * @param type Type of event, bill payment, balance, application, or attribute. For bill pay, type of payment (check, electronic)
+     */
+    @Constraint(required = true)
+    void setType(String type);
+}
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,20 @@
+package org.apache.logging.log4j.samples.events;
+
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * Member change their password.
+ *
+ * @author generated
+ */
+
+public interface ChangePassword extends org.apache.logging.log4j.samples.dto.AuditEvent {
+
+    /**
+     * Member : Member or End User number at the Host
+     *
+     * @param member Member or End User number at the Host
+     */
+    @Constraint(required = true)
+    void setMember(String member);
+}
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,32 @@
+package org.apache.logging.log4j.samples.events;
+
+/**
+ * Member logged in successfully.
+ *
+ * @author generated
+ */
+
+public interface Login extends org.apache.logging.log4j.samples.dto.AuditEvent {
+
+    /**
+     * Member : Member or End User number at the Host
+     *
+     * @param member Member or End User number at the Host
+     */
+    void setMember(String member);
+
+    /**
+     * Source : Source of the End User's request; or method user used to navigate (link, button)
+     *
+     * @param source Source of the End User's request; or method user used to navigate (link, button)
+     */
+    void setSource(String source);
+
+    /**
+     * Start Page Option : Chosen start page destination for IB login.
+     *
+     * @param startPageOption Chosen start page destination for IB login.
+     */
+    void setStartPageOption(String startPageOption);
+
+}
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,114 @@
+package org.apache.logging.log4j.samples.events;
+
+/**
+ * Member set up scheduled transaction request.
+ *
+ * @author generated
+ */
+
+public interface ScheduledTransaction extends org.apache.logging.log4j.samples.dto.AuditEvent {
+
+    /**
+     * Action : Indicates the step of the registration process.  Valid actions are: Begin, Submit, Enroll Cancel,
+     * Confirm Page, Rt In Process Attempt, Reg submitted, acct del, Account del submit, account auto-Select,
+     * Duplicate user.  Alternatively, the action the user has executed in the event
+     *
+     * @param action Indicates the step of the registration process.  Valid actions are: Begin, Submit, Enroll Cancel,
+     *               Confirm Page, Rt In Process Attempt, Reg submitted, acct del, Account del submit,
+     *               account auto-Select, Duplicate user.  Alternatively, the action the user has executed in the event
+     */
+    void setAction(String action);
+
+    /**
+     * Amount : Amount of transaction in dollars.
+     *
+     * @param amount Amount of transaction in dollars.
+     */
+    void setAmount(String amount);
+
+    /**
+     * Completion Notification : Completion notification
+     *
+     * @param completionNotification Completion notification
+     */
+    void setCompletionNotification(String completionNotification);
+
+    /**
+     * Completion Status : Whether the event succeeded or failed - success/failure and optional reason.
+     *
+     * @param completionStatus Whether the event succeeded or failed - success/failure and optional reason.
+     */
+    void setCompletionStatus(String completionStatus);
+
+    /**
+     * End Date : Final date for scheduled recurring transfers or PFM history request.
+     *
+     * @param endDate Final date for scheduled recurring transfers or PFM history request.
+     */
+    void setEndDate(String endDate);
+
+    /**
+     * Frequency : For recurring transactions, payments, the frequency (monthly, weekly) of execution.
+     *
+     * @param frequency For recurring transactions, payments, the frequency (monthly, weekly) of execution.
+     */
+    void setFrequency(String frequency);
+
+    /**
+     * From Account : For transfer or other transaction, the account funds are taken from.
+     *
+     * @param fromAccount For transfer or other transaction, the account funds are taken from.
+     */
+    void setFromAccount(String fromAccount);
+
+    /**
+     * Member : Member or End User number at the Host
+     *
+     * @param member Member or End User number at the Host
+     */
+    void setMember(String member);
+
+    /**
+     * Memo : Descriptive text or memo for transaction
+     *
+     * @param memo Descriptive text or memo for transaction
+     */
+    void setMemo(String memo);
+
+    /**
+     * Payment : Amount paid or transferred.
+     *
+     * @param payment Amount paid or transferred.
+     */
+    void setPayment(String payment);
+
+    /**
+     * Source : Source of the End User's request; or method user used to navigate (link, button)
+     *
+     * @param source Source of the End User's request; or method user used to navigate (link, button)
+     */
+    void setSource(String source);
+
+    /**
+     * SRT Identifier : Scheduled Recurring Transaction Identifier
+     *
+     * @param srtId Scheduled Recurring Transaction Identifier
+     */
+    void setSrtId(String srtId);
+
+    /**
+     * Start Date : Start date for Scheduled transfers/alerts or PFM history.
+     *
+     * @param startDate Start date for Scheduled transfers/alerts or PFM history.
+     */
+    void setStartDate(String startDate);
+
+    /**
+     * To Account : Target account or account that will receive funds in a transfer.
+     *
+     * @param toAccount Target account or account that will receive funds in a transfer.
+     */
+    void setToAccount(String toAccount);
+
+
+}
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,158 @@
+package org.apache.logging.log4j.samples.events;
+
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * Member requested transfer.
+ *
+ * @author generated
+ */
+
+public interface Transfer extends org.apache.logging.log4j.samples.dto.AuditEvent {
+
+    /**
+     * Amount : Amount of transaction in dollars.
+     *
+     * @param amount Amount of transaction in dollars.
+     */
+    @Constraint(required = true)
+    void setAmount(String amount);
+
+    /**
+     * Comment : Comment
+     *
+     * @param comment Comment
+     */
+    void setComment(String comment);
+
+    /**
+     * Completion Status : Whether the event succeeded or failed - success/failure and optional reason.
+     *
+     * @param completionStatus Whether the event succeeded or failed - success/failure and optional reason.
+     */
+    void setCompletionStatus(String completionStatus);
+
+    /**
+     * Confirmation Number : A date, time, and reference number.
+     *
+     * @param confNo A date, time, and reference number.
+     */
+    void setConfNo(String confNo);
+
+    /**
+     * From Account : For transfer or other transaction, the account funds are taken from.
+     *
+     * @param fromAccount For transfer or other transaction, the account funds are taken from.
+     */
+    @Constraint(required = true)
+    void setFromAccount(String fromAccount);
+
+    /**
+     * From Account Type : For transfer or other transaction, the type of the account funds are taken from.
+     *
+     * @param fromAccountType For transfer or other transaction, the type of the account funds are taken from.
+     */
+    void setFromAccountType(String fromAccountType);
+
+    /**
+     * From Routing Number : nine digit bank code to ID the FI from which funds are taken
+     *
+     * @param fromRoutingNumber nine digit bank code to ID the FI from which funds are taken
+     */
+    void setFromRoutingNumber(String fromRoutingNumber);
+
+    /**
+     * Member : Member or End User number at the Host
+     *
+     * @param member Member or End User number at the Host
+     */
+    @Constraint(required = true)
+    void setMember(String member);
+
+    /**
+     * Memo : Descriptive text or memo for transaction
+     *
+     * @param memo Descriptive text or memo for transaction
+     */
+    void setMemo(String memo);
+
+    /**
+     * Payment : Amount paid or transferred.
+     *
+     * @param payment Amount paid or transferred.
+     */
+    void setPayment(String payment);
+
+    /**
+     * Reference : Unique reference number or identifier for transfers.
+     *
+     * @param reference Unique reference number or identifier for transfers.
+     */
+    void setReference(String reference);
+
+    /**
+     * Result : Status of request event.
+     *
+     * @param result Status of request event.
+     */
+    void setResult(String result);
+
+    /**
+     * Source : Source of the End User's request; or method user used to navigate (link, button)
+     *
+     * @param source Source of the End User's request; or method user used to navigate (link, button)
+     */
+    void setSource(String source);
+
+    /**
+     * Status : Status of promotional email preference or online statement.
+     *
+     * @param status Status of promotional email preference or online statement.
+     */
+    void setStatus(String status);
+
+    /**
+     * Time Stamp : Time Stamp of event.
+     *
+     * @param timeStamp Time Stamp of event.
+     */
+    void setTimeStamp(long timeStamp);
+
+    /**
+     * To Account : Target account or account that will receive funds in a transfer.
+     *
+     * @param toAccount Target account or account that will receive funds in a transfer.
+     */
+    @Constraint(required = true)
+    void setToAccount(String toAccount);
+
+    /**
+     * To Account Type : Target account type such as savings or checking.
+     *
+     * @param toAccountType Target account type such as savings or checking.
+     */
+    void setToAccountType(String toAccountType);
+
+    /**
+     * To Routing Number : nine digit bank code to ID the FI to receive funds
+     *
+     * @param toRoutingNumber nine digit bank code to ID the FI to receive funds
+     */
+    void setToRoutingNumber(String toRoutingNumber);
+
+    /**
+     * Transaction Type : Type of transfer, i.e., withdrawal, LOC Paydown, CD redemption, lucky transfer.
+     *
+     * @param transactionType Type of transfer, i.e., withdrawal, LOC Paydown, CD redemption, lucky transfer.
+     */
+    void setTransactionType(String transactionType);
+
+    /**
+     * Type : Type of event, bill payment, balance, application, or attribute. For bill pay, type of payment (check, electronic)
+     *
+     * @param type Type of event, bill payment, balance, application, or attribute. For bill pay, type of payment (check, electronic)
+     */
+    void setType(String type);
+
+
+}
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java (added)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java Fri Nov 23 05:11:28 2012
@@ -0,0 +1,71 @@
+package org.apache.logging.log4j.samples.util;
+
+public class NamingUtils {
+
+    public static String getPackageName(String className) {
+        return className.substring(0, className.lastIndexOf("."));
+    }
+
+    public static String getSimpleName(String className) {
+        return className.substring(className.lastIndexOf(".") + 1);
+    }
+
+    public static String getMethodShortName(String name) {
+        return name.replaceFirst("(get|set|is|has)", "");
+    }
+
+    public static String upperFirst(String name) {
+        return String.valueOf(name.charAt(0)).toUpperCase() + name.substring(1);
+    }
+
+    public static String lowerFirst(String name) {
+        return String.valueOf(name.charAt(0)).toLowerCase() + name.substring(1);
+    }
+
+    public static String getSetterName(String fieldName) {
+        return "set" + upperFirst(fieldName);
+    }
+
+    public static String getGetterName(String fieldName, String type) {
+        if ("boolean".equals(type)) {
+            return "is" + upperFirst(fieldName);
+        } else {
+            return "get" + upperFirst(fieldName);
+        }
+    }
+
+    public static void main(String[] args) {
+        String blah = "com.test.generator.Classname";
+        System.out.println(getSimpleName(blah));
+        System.out.println(lowerFirst(getSimpleName(blah)));
+
+        System.out.println(getPackageName(blah));
+
+        System.out.println(getMethodShortName("getName"));
+        System.out.println(getMethodShortName("setName"));
+    }
+
+    public static String getClassName(String className) {
+        return upperFirst(className.replaceAll("[^a-zA-Z0-9_]+", ""));
+    }
+
+    public static String getFieldName(String fieldName) {
+        return fieldName.replaceAll("[^a-zA-Z0-9_]+", "");
+    }
+
+    public static String methodCaseName(String variable) {
+        return variable.substring(0, 1).toUpperCase() + variable.substring(1);
+    }
+
+    public static String getAccessorName(String type, String methodName) {
+        String prefix = "get";
+        if (type.equals("boolean")) {
+            prefix = "is";
+        }
+        return prefix + methodCaseName(methodName);
+    }
+
+    public static String getMutatorName(String methodName) {
+        return "set" + methodCaseName(methodName);
+    }
+}

Propchange: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 05:11:28 2012
@@ -0,0 +1,5 @@
+target
+*.iml
+.settings
+.classpath
+.project

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/README.txt
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/README.txt?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/README.txt (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/README.txt Fri Nov 23 05:11:28 2012
@@ -0,0 +1,22 @@
+Sample to utilize an embedded Flume agent to connect to a remote Flume Agent via Avro.
+
+This sample uses the classes in the sample flume-common project. It will randomly pick from the events defined there
+and send them to Flume. At the same time it will intermix some random non-audit events.
+
+To run this sample:
+1. Run "mvn install" on the flume-common project.
+2. Download and install Flume.
+3. Copy the flume-conf.properties in src/main/resources/flume/conf to the conf directory of where Flume was installed.
+4. In a terminal window start flume using "bin/flume-ng agent --conf ./conf/ -f conf/flume-conf.properties -Dflume.root.logger=DEBUG,console -n agent"
+5. Verify Flume started and configured an Avro source, a memory channel and a logger sink by reviewing the startup log.
+6. In a separate terminal window run "mvn jetty:run" in this project.
+7. Verify the Flume appender connected to the Flume agent by finding "Started SelectChannelConnector@0.0.0.0:8080"
+   in the jetty log and that there are no exceptions and also by seeing something like
+    "/127.0.0.1:53351 => /127.0.0.1:8800] OPEN" in the Flume log.
+8. In a separate terminal window in the project directory run "tail -f target/logs/app.log" to see the application
+   generate non-audit logs.
+9. In the browser go to url "http://localhost:8080/flumeAgent/start.do". A started message should appear on the screen.
+10. After verifying logs are being written click on the Stop button in the browser page.
+
+The output from the Flume agent will include the generated Flume events. Since the events are sent by the embedded
+Flume agent in a batch the Flume agent will only print a hex dump of the first few bytes of the event.
\ No newline at end of file

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/pom.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/pom.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/pom.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,149 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>log4j-samples</artifactId>
+    <groupId>org.apache.logging.log4j.samples</groupId>
+    <version>2.0-beta4-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.logging.log4j.samples</groupId>
+  <artifactId>flume-embedded</artifactId>
+  <name>flume-embedded</name>
+  <packaging>war</packaging>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.logging.log4j.samples</groupId>
+      <artifactId>flume-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j.adapters</groupId>
+      <artifactId>log4j-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j.adapters</groupId>
+      <artifactId>log4j-flume-ng</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.flume</groupId>
+      <artifactId>flume-ng-node</artifactId>
+      <version>1.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-core</artifactId>
+      <version>1.0.1</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.flume.flume-ng-channels</groupId>
+      <artifactId>flume-file-channel</artifactId>
+      <version>1.2.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>servlet-api-2.5</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+        </exclusion>
+        <!-- <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+        </exclusion>   -->
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.ws</groupId>
+      <artifactId>spring-ws-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.3.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <resources>
+      <resource>
+        <directory>${basedir}/src/main/resources</directory>
+      </resource>
+      <resource>
+        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
+        <includes>
+          <include>web.xml</include>
+        </includes>
+        <filtering>true</filtering>
+        <targetPath>${project.build.directory}</targetPath>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.10</version>
+        <configuration>
+          <contextPath>flumeAgent</contextPath>
+          <webXml>${project.build.directory}/web.xml</webXml>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <stopKey>foo</stopKey>
+          <stopPort>9999</stopPort>
+          <systemProperties>
+            <systemProperty>
+              <name>log.dir</name>
+              <value>${project.build.directory}/logs</value>
+            </systemProperty>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/flume-conf.properties
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/flume-conf.properties?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/flume-conf.properties (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/flume/conf/flume-conf.properties Fri Nov 23 05:11:28 2012
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# The configuration file needs to define the sources,
+# the channels and the sinks.
+# Sources, channels and sinks are defined per agent,
+# in this case called 'agent'
+
+agent.sources = avroSrc
+agent.channels = memoryChannel
+agent.sinks =  loggerSink
+
+# For each one of the sources, the type is defined
+# agent.sources.seqGenSrc.type = seq
+
+agent.sources.avroSrc.type = avro
+agent.sources.avroSrc.bind = localhost
+agent.sources.avroSrc.port = 8800
+
+# The channel can be defined as follows.
+agent.sources.avroSrc.channels = memoryChannel
+
+# Each sink's type must be defined
+agent.sinks.loggerSink.type = logger
+
+#Specify the channel the sink should use
+agent.sinks.loggerSink.channel = memoryChannel
+
+# Each channel's type is defined.
+agent.channels.memoryChannel.type = memory
+
+# Other config values specific to each type of channel(sink or source)
+# can be defined as well
+# In this case, it specifies the capacity of the memory channel
+agent.channels.memoryChannel.capacity = 100

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,32 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<configuration status="debug" name="Flume" verbose="false" monitorInterval="30">
+	<MarkerFilter marker="EVENT" onMatch="ACCEPT" onMismatch="NEUTRAL" />
+	<appenders>
+
+		<Flume name="flume" suppressExceptions="false" mdcPrefix="ReqCtx_" compress="false" embedded="true" dataDir="/tmp">
+			<Agent host="localhost" port="8800" />
+			<RFC5424Layout enterpriseNumber="12293" includeMDC="true" mdcId="RequestContext" appName="GL" />
+		</Flume>
+		<Console name="console">
+			<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36}:%L %M - %msg%n" />
+		</Console>
+		<RollingFile name="RollingFile" fileName="${sys:log.dir}/app.log"
+			filePattern="${sys:log.dir}/app-%d{MM-dd-yyyy}-%i.log.gz">
+			<PatternLayout>
+				<pattern>%d %p %C{1.} [%t] %m%n</pattern>
+			</PatternLayout>
+			<Policies>
+				<TimeBasedTriggeringPolicy />
+				<SizeBasedTriggeringPolicy size="250 MB" />
+			</Policies>
+		</RollingFile>
+	</appenders>
+	<loggers>
+		<logger name="EventLogger" level="WARN" additivity="false">
+			<appender-ref ref="flume" />
+		</logger>
+		<root level="debug">
+			<appender-ref ref="RollingFile" />
+		</root>
+	</loggers>
+</configuration>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/resources/log4j-embedded.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:oxm="http://www.springframework.org/schema/oxm"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+		   http://www.springframework.org/schema/oxm
+		   http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+	<context:component-scan base-package="org.apache.logging.log4j.samples">
+		<context:exclude-filter type="annotation"
+			expression="org.springframework.ws.server.endpoint.annotation.Endpoint" />
+		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
+	</context:component-scan>
+
+</beans>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,4 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+              domain="IsolatedDomain"
+              parent-first="false">
+</classloading>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-classloading.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-web>
+    <context-root>remote</context-root>
+</jboss-web>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/jboss-web.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:sws="http://www.springframework.org/schema/web-services"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+           http://www.springframework.org/schema/oxm
+           http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+	<context:component-scan base-package="org.apache.logging.log4j.samples.*" />
+
+</beans>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/rest-servlet.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+	<display-name>Global Logging Services</display-name>
+	<listener>
+		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+	</listener>
+
+	<servlet>
+		<servlet-name>rest</servlet-name>
+		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+		<load-on-startup>6</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>rest</servlet-name>
+		<url-pattern>*.do</url-pattern>
+	</servlet-mapping>
+
+	<welcome-file-list>
+		<welcome-file>index.jsp</welcome-file>
+	</welcome-file-list>
+
+	<session-config>
+		<session-timeout>5</session-timeout>
+	</session-config>
+
+	<listener>
+		<listener-class>org.apache.logging.log4j.core.web.Log4jContextListener</listener-class>
+	</listener>
+
+	<context-param>
+		<param-name>log4jConfiguration</param-name>
+		<param-value>file://${project.build.directory}/classes/log4j-embedded.xml</param-value>
+	</context-param>
+
+	<context-param>
+		<param-name>log4jContextName</param-name>
+		<param-value>GLS</param-value>
+	</context-param>
+</web-app>

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/index.jsp?rev=1412753&view=auto
==============================================================================
    (empty)

Propchange: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:executable = *

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/start.jsp
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/start.jsp?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/start.jsp (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/start.jsp Fri Nov 23 05:11:28 2012
@@ -0,0 +1,14 @@
+<html>
+<body>
+
+<h2>Rest Client</h2>
+<p>
+    Started
+</p>
+<form action="stop.do" method="GET">
+    <input type="submit" value="Stop" />
+</form>
+</body>
+</html>
+
+

Added: logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/stop.jsp
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/stop.jsp?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/stop.jsp (added)
+++ logging/log4j/log4j2/trunk/samples/flume-embedded/src/main/webapp/stop.jsp Fri Nov 23 05:11:28 2012
@@ -0,0 +1,12 @@
+<html>
+<body>
+
+<h2>Rest Client</h2>
+<p>
+    Stopped
+</p>
+<form action="start.do" method="GET">
+    <input type="submit" value="Start" />
+</form>
+</body>
+</html>
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/samples/flume-remote/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 05:11:28 2012
@@ -0,0 +1,5 @@
+target
+*.iml
+.settings
+.classpath
+.project

Added: logging/log4j/log4j2/trunk/samples/flume-remote/README.txt
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-remote/README.txt?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-remote/README.txt (added)
+++ logging/log4j/log4j2/trunk/samples/flume-remote/README.txt Fri Nov 23 05:11:28 2012
@@ -0,0 +1,26 @@
+Sample to connect to a Flume Agent via Avro using the FlumeAppender.
+
+This sample uses the classes in the sample flume-common project. It will randomly pick from the events defined there
+and send them to Flume. At the same time it will intermix some random non-audit events.
+
+To run this sample:
+1. Run "mvn install" on the flume-common project.
+2. Download and install Flume.
+3. Copy the flume-conf.properties in src/main/resources/flume/conf to the conf directory of where Flume was installed.
+4. In a terminal window start flume using "bin/flume-ng agent --conf ./conf/ -f conf/flume-conf.properties -Dflume.root.logger=DEBUG,console -n agent"
+5. Verify Flume started and configured an Avro source, a memory channel and a logger sink by reviewing the startup log.
+6. In a separate terminal window run "mvn jetty:run" in this project.
+7. Verify the Flume appender connected to the Flume agent by finding "Starting FlumeAvroManager FlumeAvro[localhost:8800]"
+   in the jetty log and that there are no exceptions and also by seeing something like
+    "/127.0.0.1:53351 => /127.0.0.1:8800] OPEN" in the Flume log.
+8. In a separate terminal window in the project directory run "tail -f target/logs/app.log" to see the application
+   generate non-audit logs.
+9. In the browser go to url "http://localhost:8080/flumeAgent/start.do". A started message should appear on the screen.
+10. After verifying logs are being written click on the Stop button in the browser page.
+
+Note that the Flume agent must be started for the FlumeAppender to successfully start. If the Flume agent is stopped
+an exception will be thrown for each event that occurs while the agent is down. When the agent restarts the
+appender will automatically reconnect.
+
+The output from the Flume agent will include the generated Flume events. Since the events are sent individually
+Avro will print the full event and Flume will print a hex dump of the first few bytes of the event.
\ No newline at end of file

Added: logging/log4j/log4j2/trunk/samples/flume-remote/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-remote/pom.xml?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-remote/pom.xml (added)
+++ logging/log4j/log4j2/trunk/samples/flume-remote/pom.xml Fri Nov 23 05:11:28 2012
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>log4j-samples</artifactId>
+    <groupId>org.apache.logging.log4j.samples</groupId>
+    <version>2.0-beta4-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.logging.log4j.samples</groupId>
+  <artifactId>flume-remote</artifactId>
+  <name>flume-remote</name>
+  <packaging>war</packaging>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.logging.log4j.samples</groupId>
+      <artifactId>flume-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j.adapters</groupId>
+      <artifactId>log4j-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j.adapters</groupId>
+      <artifactId>log4j-flume-ng</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.ws</groupId>
+      <artifactId>spring-ws-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.3.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <resources>
+      <resource>
+        <directory>${basedir}/src/main/resources</directory>
+      </resource>
+      <resource>
+        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
+        <includes>
+          <include>web.xml</include>
+        </includes>
+        <filtering>true</filtering>
+        <targetPath>${project.build.directory}</targetPath>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.10</version>
+        <configuration>
+          <contextPath>flumeAgent</contextPath>
+          <webXml>${project.build.directory}/web.xml</webXml>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <stopKey>foo</stopKey>
+          <stopPort>9999</stopPort>
+          <systemProperties>
+            <systemProperty>
+              <name>log.dir</name>
+              <value>${project.build.directory}/logs</value>
+            </systemProperty>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/flume-conf.properties
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/flume-conf.properties?rev=1412753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/flume-conf.properties (added)
+++ logging/log4j/log4j2/trunk/samples/flume-remote/src/main/resources/flume/conf/flume-conf.properties Fri Nov 23 05:11:28 2012
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# The configuration file needs to define the sources,
+# the channels and the sinks.
+# Sources, channels and sinks are defined per agent,
+# in this case called 'agent'
+
+agent.sources = avroSrc
+agent.channels = memoryChannel
+agent.sinks =  loggerSink
+
+# For each one of the sources, the type is defined
+# agent.sources.seqGenSrc.type = seq
+
+agent.sources.avroSrc.type = avro
+agent.sources.avroSrc.bind = localhost
+agent.sources.avroSrc.port = 8800
+
+# The channel can be defined as follows.
+agent.sources.avroSrc.channels = memoryChannel
+
+# Each sink's type must be defined
+agent.sinks.loggerSink.type = logger
+
+#Specify the channel the sink should use
+agent.sinks.loggerSink.channel = memoryChannel
+
+# Each channel's type is defined.
+agent.channels.memoryChannel.type = memory
+
+# Other config values specific to each type of channel(sink or source)
+# can be defined as well
+# In this case, it specifies the capacity of the memory channel
+agent.channels.memoryChannel.capacity = 100



Mime
View raw message