You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2023/02/16 22:02:01 UTC

[logging-log4j-samples] 04/05: Migrate `log4j-samples-flume-common` module

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-samples.git

commit e85bfdeb119ef90fada5743537e7b5dd3fc27fee
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Thu Feb 16 22:01:14 2023 +0100

    Migrate `log4j-samples-flume-common` module
---
 log4j-samples-flume-common/pom.xml                 |  68 ++++++++
 .../logging/log4j/samples/app/LogEventFactory.java | 104 +++++++++++++
 .../logging/log4j/samples/app/LoggingApp.java      | 143 +++++++++++++++++
 .../log4j/samples/app/LoggingController.java       | 143 +++++++++++++++++
 .../log4j/samples/app/MockEventsSupplier.java      |  98 ++++++++++++
 .../logging/log4j/samples/dto/AuditEvent.java      |  25 +++
 .../logging/log4j/samples/dto/Constraint.java      |  39 +++++
 .../logging/log4j/samples/dto/RequestContext.java  | 172 ++++++++++++++++++++
 .../apache/logging/log4j/samples/events/Alert.java |  79 ++++++++++
 .../log4j/samples/events/ChangePassword.java       |  35 +++++
 .../apache/logging/log4j/samples/events/Login.java |  48 ++++++
 .../log4j/samples/events/ScheduledTransaction.java | 130 ++++++++++++++++
 .../logging/log4j/samples/events/Transfer.java     | 173 +++++++++++++++++++++
 .../logging/log4j/samples/util/NamingUtils.java    |  85 ++++++++++
 pom.xml                                            |   1 +
 15 files changed, 1343 insertions(+)

diff --git a/log4j-samples-flume-common/pom.xml b/log4j-samples-flume-common/pom.xml
new file mode 100644
index 0000000..6442241
--- /dev/null
+++ b/log4j-samples-flume-common/pom.xml
@@ -0,0 +1,68 @@
+<?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
+ 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.
+-->
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.logging.log4j.samples</groupId>
+    <artifactId>log4j-samples</artifactId>
+    <version>${revision}</version>
+  </parent>
+  <artifactId>log4j-samples-flume-common</artifactId>
+  <packaging>jar</packaging>
+  <name>Apache Log4j Samples: Flume - Common</name>
+  <properties>
+    <revision>2.19.1-SNAPSHOT</revision>
+  </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>javax.servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
new file mode 100755
index 0000000..cc17609
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
@@ -0,0 +1,104 @@
+/*
+ * 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.app;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+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;
+
+/**
+ *
+ */
+public class LogEventFactory {
+
+    @SuppressWarnings("unchecked")
+    public static <T extends AuditEvent> T getEvent(final Class<T> intrface) {
+
+        final String eventId = NamingUtils.lowerFirst(intrface.getSimpleName());
+        final StructuredDataMessage msg = new StructuredDataMessage(eventId, null, "Audit");
+        return (T)Proxy.newProxyInstance(intrface
+            .getClassLoader(), new Class<?>[]{intrface}, new AuditProxy(msg, intrface));
+    }
+
+    private static class AuditProxy implements InvocationHandler {
+
+        private final StructuredDataMessage msg;
+        private final Class<?> intrface;
+
+        public AuditProxy(final StructuredDataMessage msg, final Class<?> intrface) {
+            this.msg = msg;
+            this.intrface = intrface;
+        }
+
+        @Override
+        public Object invoke(final Object o, final Method method, final Object[] objects)
+            throws Throwable {
+            if (method.getName().equals("logEvent")) {
+
+                final StringBuilder missing = new StringBuilder();
+
+                final Method[] methods = intrface.getMethods();
+
+                for (final Method _method : methods) {
+                    final String name = NamingUtils.lowerFirst(NamingUtils
+                        .getMethodShortName(_method.getName()));
+
+                    final Annotation[] annotations = _method.getDeclaredAnnotations();
+                    for (final Annotation annotation : annotations) {
+                        final 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")) {
+                final String name = NamingUtils.lowerFirst(NamingUtils.getMethodShortName(method.getName()));
+                msg.put(name, objects[0].toString());
+            }
+            if (method.getName().startsWith("set")) {
+                final 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;
+        }
+
+    }
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java
new file mode 100644
index 0000000..944082f
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java
@@ -0,0 +1,143 @@
+/*
+ * 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.app;
+
+import java.util.List;
+import java.util.Random;
+
+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;
+
+
+/**
+ * The Class LoggingApp.
+ */
+public class LoggingApp {
+
+    /**
+     * The logger.
+     */
+    private static Logger logger = LogManager.getLogger(LoggingApp.class);
+
+    private final Random ran = new Random();
+
+    private List<AuditEvent> events;
+
+    public static void main(final String[] args) {
+        String member = "fakemember";
+        if (args.length == 1) {
+            member = args[0];
+        }
+        final LoggingApp app = new LoggingApp(member);
+        app.runApp(member);
+        System.out.println("Job ended");
+    }
+
+    public LoggingApp(final String member) {
+
+        ThreadContext.clearMap();
+
+        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");
+
+        if (events == null) {
+            events = MockEventsSupplier.getAllEvents(member);
+        }
+    }
+
+    public void runApp(final String member) {
+        final Worker worker = new Worker(member);
+        worker.start();
+        sleep(30000);
+        worker.shutdown();
+        sleep(5000);
+    }
+
+    private void sleep(final long millis) {
+        try {
+            Thread.sleep(millis);
+        } catch (final InterruptedException ie) {
+            //
+        }
+    }
+
+
+    public class Worker extends Thread {
+
+        private final String member;
+
+        private boolean shutdown = false;
+
+        public Worker(final String member) {
+            this.member = member;
+        }
+
+        @Override
+        public void run() {
+            System.out.println("STARTING..................");
+
+            while (!shutdown) {
+                // Generate rand number between 1 to 10
+                final int rand = ran.nextInt(9) + 1;
+
+                // Sleep for rand seconds
+                try {
+                    Thread.sleep(rand * 1000);
+                } catch (final InterruptedException e) {
+                    logger.warn("WARN", e);
+                }
+
+                // Write rand number of logs
+                for (int i = 0; i < rand; i++) {
+                    final int eventIndex = (Math.abs(ran.nextInt())) % events.size();
+                    final 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.....");
+                    }
+                }
+
+            }
+        }
+
+        public void shutdown() {
+            this.shutdown = true;
+            try {
+                this.join();
+            } catch (final InterruptedException ie) {
+                //
+            }
+            System.out.println("SHUTDOWN.......................");
+        }
+    }
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java
new file mode 100755
index 0000000..bd8fe99
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingController.java
@@ -0,0 +1,143 @@
+/*
+ * 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.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.core.util.Integers;
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.RequestContext;
+import org.apache.logging.log4j.util.Strings;
+
+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;
+    private final Random ran = new Random();
+
+    private List<AuditEvent> events;
+    private int timeBase = 1000;
+
+    @RequestMapping(value = "/start.do", method = RequestMethod.GET)
+    public ModelAndView startLogging(
+        @RequestParam(value = "member", required = false, defaultValue = "fakemember") final String member,
+        @RequestParam(value = "interval", required = false, defaultValue = "1000") final String interval,
+        @RequestParam(value = "threads", required = false, defaultValue = "1") final String threadCount,
+                      final HttpServletRequest servletRequest) {
+        int numThreads = 1;
+        if (Strings.isNotEmpty(threadCount)) {
+            try {
+                numThreads = Integers.parseInt(threadCount);
+            } catch (final Exception ex) {
+                System.out.println("Invalid threadCount specified: " + threadCount);
+            }
+        }
+        if (Strings.isNotEmpty(interval)) {
+            try {
+                timeBase = Integer.parseInt(interval);
+            } catch (final Exception ex) {
+                System.out.println("Invalid interval specified: " + interval);
+            }
+        }
+        System.out.println("STARTING - Using " + numThreads + " threads at interval: " + timeBase);
+
+        if (events == null) {
+            events = MockEventsSupplier.getAllEvents(member);
+        }
+
+        generateLog = true;
+
+        for (int i = 0; i < numThreads; ++i) {
+            (new Thread() {
+
+                @Override
+                public void run() {
+                    ThreadContext.clearMap();
+
+                    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");
+                    while (generateLog) {
+                        // Generate rand number between 1 to 10
+                        final int rand = ran.nextInt(9) + 1;
+
+                        // Sleep for rand seconds
+                        try {
+                            Thread.sleep(rand * timeBase);
+                        } catch (final InterruptedException e) {
+                            logger.warn("WARN", e);
+                        }
+
+                        // Write rand number of logs
+                        for (int i = 0; i < rand; i++) {
+                            final int eventIndex = (Math.abs(ran.nextInt())) % events.size();
+                            final 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.....");
+                            }
+                        }
+
+                    }
+                    ThreadContext.cloneStack();
+                }
+            }).start();
+        }
+
+        return new ModelAndView("start.jsp");
+    }
+
+    @RequestMapping(value = "/stop.do", method = RequestMethod.GET)
+    public ModelAndView stopLogging(final HttpServletRequest servletRequest) {
+        generateLog = false;
+        return new ModelAndView("stop.jsp");
+    }
+
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java
new file mode 100755
index 0000000..bdd64b4
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/app/MockEventsSupplier.java
@@ -0,0 +1,98 @@
+/*
+ * 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.app;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+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;
+
+public class MockEventsSupplier {
+
+    /* This provides random generation */
+    static Random random = new Random();
+
+    public static List<AuditEvent> getAllEvents(final String member) {
+
+        final List<AuditEvent> events = new ArrayList<>();
+
+
+        final Login login = LogEventFactory.getEvent(Login.class);
+        login.setStartPageOption("account summary");
+        login.setSource("online");
+        login.setMember(member);
+        events.add(login);
+
+        final ChangePassword changePassword = LogEventFactory.getEvent(ChangePassword.class);
+        changePassword.setMember(member);
+        events.add(changePassword);
+
+        final 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);
+
+        final 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);
+
+        final 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;
+    }
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java
new file mode 100755
index 0000000..67694e6
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/AuditEvent.java
@@ -0,0 +1,25 @@
+/*
+ * 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;
+
+/**
+ * Interface that indicates the Class was generated by the DTOManager.
+ */
+public interface AuditEvent {
+
+    void logEvent();
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java
new file mode 100755
index 0000000..c0e83cf
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/Constraint.java
@@ -0,0 +1,39 @@
+/*
+ * 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 java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.logging.log4j.util.Strings;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Constraint {
+
+    boolean required() default false;
+
+    String pattern() default Strings.EMPTY;
+
+    int minLength() default -1;
+
+    int maxLength() default -1;
+
+    int totalDigits() default -1;
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java
new file mode 100644
index 0000000..f7b6fc5
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/dto/RequestContext.java
@@ -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.util.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.clearMap();
+        ThreadContext.put(REQUEST_ID, UuidUtil.getTimeBasedUuid().toString());
+    }
+
+    public static String getId() {
+        return ThreadContext.get(REQUEST_ID);
+    }
+
+    public static void setSessionId(final String id) {
+        ThreadContext.put(SESSION_ID, id);
+    }
+
+    public static String getSessionId() {
+        return ThreadContext.get(SESSION_ID);
+    }
+
+    public static void setTransId(final String id) {
+        ThreadContext.put(TRANSACTION_ID,  id);
+    }
+
+    public static String getTransId() {
+        return ThreadContext.get(TRANSACTION_ID);
+    }
+
+    public static void setRequestURI(final String URI) {
+        ThreadContext.put(REQUEST_URI,  URI);
+    }
+
+    public static String getRequestURI() {
+        return ThreadContext.get(REQUEST_URI);
+    }
+
+    public static void setLoginId(final String id) {
+        ThreadContext.put(LOGIN_ID,  id);
+    }
+
+    public static String getLoginId() {
+        return ThreadContext.get(LOGIN_ID);
+    }
+
+    public static void setUserId(final String id) {
+        ThreadContext.put(USER_ID,  id);
+    }
+
+    public static String getUserId() {
+        return ThreadContext.get(USER_ID);
+    }
+
+    public static void setUserType(final String type) {
+        ThreadContext.put(USER_TYPE,  type);
+    }
+
+    public static String getUserType() {
+        return ThreadContext.get(USER_TYPE);
+    }
+
+    public static void setClientId(final String id) {
+        ThreadContext.put(CLIENT_ID,  id);
+    }
+
+    public static String getClientId() {
+        return ThreadContext.get(CLIENT_ID);
+    }
+
+    public static void setIpAddress(final String addr) {
+        ThreadContext.put(IP_ADDRESS,  addr);
+    }
+
+    public static String getIpAddress() {
+        return ThreadContext.get(IP_ADDRESS);
+    }
+
+    public static void setProductName(final String productName) {
+        ThreadContext.put(PRODUCT_NAME, productName);
+    }
+
+    public static String getProductName() {
+        return ThreadContext.get(PRODUCT_NAME);
+    }
+
+
+    public static void setProductVersion(final String productVersion) {
+        ThreadContext.put(PRODUCT_VERSION, productVersion);
+    }
+
+    public static String getProductVersion() {
+        return ThreadContext.get(PRODUCT_VERSION);
+    }
+
+    public static void setLocale(final String locale) {
+        ThreadContext.put(LOCALE, locale);
+    }
+
+    public static String getLocale() {
+        return ThreadContext.get(LOCALE);
+    }
+
+    public static void setRegion(final String region) {
+        ThreadContext.put(REGION, region);
+    }
+
+    public static String getRegion() {
+        return ThreadContext.get(REGION);
+    }
+
+    public static void setUserAgent(final String agent) {
+        ThreadContext.put(USER_AGENT, agent);
+    }
+
+    public static String getUserAgent() {
+        return ThreadContext.get(USER_AGENT);
+    }
+
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java
new file mode 100755
index 0000000..4068635
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Alert.java
@@ -0,0 +1,79 @@
+/*
+ * 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.events;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * The user sets up account balance alerts.
+ */
+
+public interface Alert extends 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);
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java
new file mode 100755
index 0000000..b797466
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ChangePassword.java
@@ -0,0 +1,35 @@
+/*
+ * 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.events;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * Member change their password.
+ */
+
+public interface ChangePassword extends 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);
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java
new file mode 100755
index 0000000..a7b07ec
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Login.java
@@ -0,0 +1,48 @@
+/*
+ * 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.events;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+
+/**
+ * Member logged in successfully.
+ */
+
+public interface Login extends 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);
+
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java
new file mode 100755
index 0000000..c5d7aad
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/ScheduledTransaction.java
@@ -0,0 +1,130 @@
+/*
+ * 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.events;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+
+/**
+ * Member set up scheduled transaction request.
+ */
+
+public interface ScheduledTransaction extends 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);
+
+
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java
new file mode 100755
index 0000000..a5be724
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/events/Transfer.java
@@ -0,0 +1,173 @@
+/*
+ * 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.events;
+
+import org.apache.logging.log4j.samples.dto.AuditEvent;
+import org.apache.logging.log4j.samples.dto.Constraint;
+
+/**
+ * Member requested transfer.
+ */
+
+public interface Transfer extends 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);
+
+
+}
diff --git a/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java
new file mode 100755
index 0000000..f6552fb
--- /dev/null
+++ b/log4j-samples-flume-common/src/main/java/org/apache/logging/log4j/samples/util/NamingUtils.java
@@ -0,0 +1,85 @@
+/*
+ * 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.util;
+
+import org.apache.logging.log4j.util.Strings;
+
+public class NamingUtils {
+
+    public static String getPackageName(final String className) {
+        return className.substring(0, className.lastIndexOf("."));
+    }
+
+    public static String getSimpleName(final String className) {
+        return className.substring(className.lastIndexOf(".") + 1);
+    }
+
+    public static String getMethodShortName(final String name) {
+        return name.replaceFirst("(get|set|is|has)", Strings.EMPTY);
+    }
+
+    public static String upperFirst(final String name) {
+        return String.valueOf(name.charAt(0)).toUpperCase() + name.substring(1);
+    }
+
+    public static String lowerFirst(final String name) {
+        return String.valueOf(name.charAt(0)).toLowerCase() + name.substring(1);
+    }
+
+    public static String getSetterName(final String fieldName) {
+        return "set" + upperFirst(fieldName);
+    }
+
+    public static String getGetterName(final String fieldName, final String type) {
+        return ("boolean".equals(type) ? "is" : "get") + upperFirst(fieldName);
+    }
+
+    public static void main(final String[] args) {
+        final 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(final String className) {
+        return upperFirst(className.replaceAll("[^a-zA-Z0-9_]+", Strings.EMPTY));
+    }
+
+    public static String getFieldName(final String fieldName) {
+        return fieldName.replaceAll("[^a-zA-Z0-9_]+", Strings.EMPTY);
+    }
+
+    public static String methodCaseName(final String variable) {
+        return variable.substring(0, 1).toUpperCase() + variable.substring(1);
+    }
+
+    public static String getAccessorName(final String type, final String methodName) {
+        String prefix = "get";
+        if (type.equals("boolean")) {
+            prefix = "is";
+        }
+        return prefix + methodCaseName(methodName);
+    }
+
+    public static String getMutatorName(final String methodName) {
+        return "set" + methodCaseName(methodName);
+    }
+}
diff --git a/pom.xml b/pom.xml
index 94346f5..2b76da4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,6 +37,7 @@
 
   <modules>
     <module>log4j-samples-configuration</module>
+    <module>log4j-samples-flume-common</module>
     <module>log4j-samples-loggerProperties</module>
   </modules>