airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimuthu...@apache.org
Subject [airavata] branch develop updated: Migrating job-monitors to use logback logging
Date Mon, 02 Apr 2018 15:01:38 GMT
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new ccf7e01  Migrating job-monitors to use logback logging
ccf7e01 is described below

commit ccf7e01c69737d9ceb8ca4f8376d80d2a64ec00e
Author: dimuthu <dimuthu.upeksha2@gmail.com>
AuthorDate: Mon Apr 2 11:01:29 2018 -0400

    Migrating job-monitors to use logback logging
---
 modules/job-monitor/email-monitor/pom.xml          | 20 ++++----
 .../src/main/resources/log4j.properties            | 33 --------------
 .../email-monitor/src/main/resources/logback.xml   | 53 ++++++++++++++++++++++
 .../main/assembly/email-monitor-bin-assembly.xml   | 10 ++--
 .../assembly/realtime-monitor-bin-assembly.xml     | 10 ++--
 .../email-monitor/bin/email-monitor-daemon.sh      |  2 +-
 .../resources/email-monitor/bin/email-monitor.sh   |  2 +-
 .../resources/email-monitor/conf/log4j.properties  | 32 -------------
 .../main/resources/email-monitor/conf/logback.xml  | 53 ++++++++++++++++++++++
 .../bin/realtime-monitor-daemon.sh                 |  2 +-
 .../realtime-monitor/bin/realtime-monitor.sh       |  2 +-
 .../realtime-monitor/conf/log4j.properties         | 32 -------------
 .../resources/realtime-monitor/conf/logback.xml    | 53 ++++++++++++++++++++++
 modules/job-monitor/pom.xml                        | 15 ++++++
 modules/job-monitor/real-time-monitor/pom.xml      | 10 ++--
 .../src/main/resources/logback.xml                 | 53 ++++++++++++++++++++++
 16 files changed, 262 insertions(+), 120 deletions(-)

diff --git a/modules/job-monitor/email-monitor/pom.xml b/modules/job-monitor/email-monitor/pom.xml
index 0080207..2a30c40 100644
--- a/modules/job-monitor/email-monitor/pom.xml
+++ b/modules/job-monitor/email-monitor/pom.xml
@@ -39,14 +39,6 @@
             <version>0.17-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
         </dependency>
@@ -54,5 +46,17 @@
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>log4j-over-slf4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.danielwegener</groupId>
+            <artifactId>logback-kafka-appender</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file
diff --git a/modules/job-monitor/email-monitor/src/main/resources/log4j.properties b/modules/job-monitor/email-monitor/src/main/resources/log4j.properties
deleted file mode 100644
index e927e15..0000000
--- a/modules/job-monitor/email-monitor/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=INFO, CONSOLE, FILE
-
-log4j.category.org.apache.helix=WARN
-log4j.category.org.apache.zookeeper=WARN
-log4j.category.org.apache.kafka=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
-
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${airavata.home}/logs/airavata.log
-log4j.appender.FILE.MaxFileSize=100MB
-log4j.appender.FILE.MaxBackupIndex=1
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
\ No newline at end of file
diff --git a/modules/job-monitor/email-monitor/src/main/resources/logback.xml b/modules/job-monitor/email-monitor/src/main/resources/logback.xml
new file mode 100644
index 0000000..ef38b65
--- /dev/null
+++ b/modules/job-monitor/email-monitor/src/main/resources/logback.xml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>../logs/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/assembly/email-monitor-bin-assembly.xml
b/modules/job-monitor/job-monitor-distribution/src/main/assembly/email-monitor-bin-assembly.xml
index 53c8409..41e4afc 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/assembly/email-monitor-bin-assembly.xml
+++ b/modules/job-monitor/job-monitor-distribution/src/main/assembly/email-monitor-bin-assembly.xml
@@ -59,7 +59,7 @@
             <includes>
                 <include>airavata-server.properties</include>
                 <include>email-config.yaml</include>
-                <include>log4j.properties</include>
+                <include>logback.xml</include>
             </includes>
         </fileSet>
 
@@ -99,9 +99,11 @@
 
                 <!-- logging jars -->
                 <include>org.slf4j:slf4j-api:jar</include>
-                <include>org.slf4j:slf4j-log4j12:jar</include>
-                <include>log4j:log4j:jar</include>
-
+                <include>ch.qos.logback:logback-classic:jar</include>
+                <include>ch.qos.logback:logback-core:jar</include>
+                <include>org.slf4j:log4j-over-slf4j:jar</include>
+                <include>com.github.danielwegener:logback-kafka-appender:jar</include>
+                <include>net.logstash.logback:logstash-logback-encoder:jar</include>
             </includes>
         </dependencySet>
     </dependencySets>
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/assembly/realtime-monitor-bin-assembly.xml
b/modules/job-monitor/job-monitor-distribution/src/main/assembly/realtime-monitor-bin-assembly.xml
index 7fd0a05..c858506 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/assembly/realtime-monitor-bin-assembly.xml
+++ b/modules/job-monitor/job-monitor-distribution/src/main/assembly/realtime-monitor-bin-assembly.xml
@@ -58,7 +58,7 @@
             <fileMode>777</fileMode>
             <includes>
                 <include>airavata-server.properties</include>
-                <include>log4j.properties</include>
+                <include>logback.xml</include>
             </includes>
         </fileSet>
 
@@ -104,9 +104,11 @@
 
                 <!-- logging jars -->
                 <include>org.slf4j:slf4j-api:jar</include>
-                <include>org.slf4j:slf4j-log4j12:jar</include>
-                <include>log4j:log4j:jar</include>
-
+                <include>ch.qos.logback:logback-classic:jar</include>
+                <include>ch.qos.logback:logback-core:jar</include>
+                <include>org.slf4j:log4j-over-slf4j:jar</include>
+                <include>com.github.danielwegener:logback-kafka-appender:jar</include>
+                <include>net.logstash.logback:logstash-logback-encoder:jar</include>
             </includes>
         </dependencySet>
     </dependencySets>
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
index 05b80c3..c87e5be 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor-daemon.sh
@@ -23,7 +23,7 @@ CWD="$PWD"
 cd ${AIRAVATA_HOME}/bin
 LOGO_FILE="logo.txt"
 
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlog4j.configuration=file:${AIRAVATA_HOME}/conf/log4j.properties"
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
 AIRAVATA_COMMAND=""
 EXTRA_ARGS=""
 SERVERS=""
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor.sh
b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor.sh
index bf29487..0d58079 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor.sh
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/bin/email-monitor.sh
@@ -23,7 +23,7 @@ CWD="$PWD"
 cd ${AIRAVATA_HOME}/bin
 LOGO_FILE="logo.txt"
 
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlog4j.configuration=file:${AIRAVATA_HOME}/conf/log4j.properties"
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
 AIRAVATA_COMMAND=""
 EXTRA_ARGS=""
 SERVERS=""
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/log4j.properties
b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/log4j.properties
deleted file mode 100644
index 7f9631c..0000000
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/log4j.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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.
-
-log4j.rootLogger=INFO, CONSOLE, FILE
-
-log4j.category.org.apache.helix=WARN
-log4j.category.org.apache.zookeeper=WARN
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
-
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${airavata.home}/logs/airavata.log
-log4j.appender.FILE.MaxFileSize=100MB
-log4j.appender.FILE.MaxBackupIndex=1
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
\ No newline at end of file
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/logback.xml
b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/logback.xml
new file mode 100644
index 0000000..ef38b65
--- /dev/null
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/email-monitor/conf/logback.xml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>../logs/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
index 7faf356..87f2878 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor-daemon.sh
@@ -23,7 +23,7 @@ CWD="$PWD"
 cd ${AIRAVATA_HOME}/bin
 LOGO_FILE="logo.txt"
 
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlog4j.configuration=file:${AIRAVATA_HOME}/conf/log4j.properties"
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
 AIRAVATA_COMMAND=""
 EXTRA_ARGS=""
 SERVERS=""
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor.sh
b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor.sh
index 9838636..e9f814e 100644
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor.sh
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/bin/realtime-monitor.sh
@@ -23,7 +23,7 @@ CWD="$PWD"
 cd ${AIRAVATA_HOME}/bin
 LOGO_FILE="logo.txt"
 
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlog4j.configuration=file:${AIRAVATA_HOME}/conf/log4j.properties"
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
 AIRAVATA_COMMAND=""
 EXTRA_ARGS=""
 SERVERS=""
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/log4j.properties
b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/log4j.properties
deleted file mode 100644
index 7f9631c..0000000
--- a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/log4j.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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.
-
-log4j.rootLogger=INFO, CONSOLE, FILE
-
-log4j.category.org.apache.helix=WARN
-log4j.category.org.apache.zookeeper=WARN
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
-
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${airavata.home}/logs/airavata.log
-log4j.appender.FILE.MaxFileSize=100MB
-log4j.appender.FILE.MaxBackupIndex=1
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p
%c %x - %m [E=%X{experiment},P=%X{process},T=%X{task},G=%X{gateway}]%n
\ No newline at end of file
diff --git a/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/logback.xml
b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/logback.xml
new file mode 100644
index 0000000..ef38b65
--- /dev/null
+++ b/modules/job-monitor/job-monitor-distribution/src/main/resources/realtime-monitor/conf/logback.xml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>../logs/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>
diff --git a/modules/job-monitor/pom.xml b/modules/job-monitor/pom.xml
index 1d1b514..eb10e1f 100644
--- a/modules/job-monitor/pom.xml
+++ b/modules/job-monitor/pom.xml
@@ -51,6 +51,21 @@
                 <artifactId>mail</artifactId>
                 <version>1.4.5</version>
             </dependency>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>log4j-over-slf4j</artifactId>
+                <version>1.7.25</version>
+            </dependency>
+            <dependency>
+                <groupId>com.github.danielwegener</groupId>
+                <artifactId>logback-kafka-appender</artifactId>
+                <version>0.2.0-RC1</version>
+            </dependency>
+            <dependency>
+                <groupId>net.logstash.logback</groupId>
+                <artifactId>logstash-logback-encoder</artifactId>
+                <version>5.0</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>
\ No newline at end of file
diff --git a/modules/job-monitor/real-time-monitor/pom.xml b/modules/job-monitor/real-time-monitor/pom.xml
index 9639056..5626449 100644
--- a/modules/job-monitor/real-time-monitor/pom.xml
+++ b/modules/job-monitor/real-time-monitor/pom.xml
@@ -44,11 +44,15 @@
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
+            <artifactId>log4j-over-slf4j</artifactId>
         </dependency>
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
+            <groupId>com.github.danielwegener</groupId>
+            <artifactId>logback-kafka-appender</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
         </dependency>
     </dependencies>
 
diff --git a/modules/job-monitor/real-time-monitor/src/main/resources/logback.xml b/modules/job-monitor/real-time-monitor/src/main/resources/logback.xml
new file mode 100644
index 0000000..ef38b65
--- /dev/null
+++ b/modules/job-monitor/real-time-monitor/src/main/resources/logback.xml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>../logs/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>

-- 
To stop receiving notification emails like this one, please contact
dimuthuupe@apache.org.

Mime
View raw message