Alon Bar-Lev has uploaded a new change for review.

Change subject: notifier: switch to log4j
......................................................................

notifier: switch to log4j

for some reason no logs using current logger.

also fix log4j.xml as it complains about format.

Change-Id: I35de5d5a97ccd4f7bb80739fdb328de2e0ce6bd9
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/EngineMonitorService.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/Notifier.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationConfigurator.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/EventSenderMailImpl.java
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
M packaging/etc/notifier/log4j.xml.in
8 files changed, 15 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/14377/1

diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/EngineMonitorService.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/EngineMonitorService.java
index fa8556c..62a653b 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/EngineMonitorService.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/EngineMonitorService.java
@@ -31,8 +31,7 @@
 import javax.sql.DataSource;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.common.AuditLogSeverity;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.config.ConfigCommon;
@@ -53,7 +52,7 @@
  */
 public class EngineMonitorService implements Runnable {
 
-    private static final Log log = 
LogFactory.getLog(EngineMonitorService.class);
+    private static final Logger log = 
Logger.getLogger(EngineMonitorService.class);
     private static final String ENGINE_NOT_RESPONDING_ERROR = "Engine server 
is not responding.";
     private static final String ENGINE_RESPONDING_MESSAGE = "Engine server is 
up and running.";
     private static final String HEALTH_SERVLET_PATH = 
"/OvirtEngineWeb/HealthStatus";
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
index e3483a5..6743a1d 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
@@ -16,8 +16,7 @@
 import javax.sql.DataSource;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.common.EventNotificationMethods;
 import org.ovirt.engine.core.common.businessentities.DbUser;
 import org.ovirt.engine.core.common.businessentities.EventAuditLogSubscriber;
@@ -41,7 +40,7 @@
  */
 public class NotificationService implements Runnable {
 
-    private static final Log log = 
LogFactory.getLog(NotificationService.class);
+    private static final Logger log = 
Logger.getLogger(NotificationService.class);
 
     private DataSource ds;
     private Map<String, String> prop = null;
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/Notifier.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/Notifier.java
index 516051d..78e2c93 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/Notifier.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/Notifier.java
@@ -7,8 +7,7 @@
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.notifier.utils.NotificationConfigurator;
 import org.ovirt.engine.core.notifier.utils.NotificationProperties;
 
@@ -21,7 +20,7 @@
 @SuppressWarnings("restriction")
 public class Notifier {
 
-    private static final Log log = LogFactory.getLog(Notifier.class);
+    private static final Logger log = Logger.getLogger(Notifier.class);
     private static ScheduledExecutorService notifyScheduler = 
Executors.newSingleThreadScheduledExecutor();
     private static ScheduledExecutorService monitorScheduler = 
Executors.newSingleThreadScheduledExecutor();
     private static final long DEFAULT_NOTIFICATION_INTERVAL_IN_SECONDS = 120;
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationConfigurator.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationConfigurator.java
index ae03c2a..75fae30 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationConfigurator.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationConfigurator.java
@@ -4,8 +4,7 @@
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.notifier.NotificationServiceException;
 
 /**
@@ -14,7 +13,7 @@
  */
 public class NotificationConfigurator {
 
-    private static final Log log = 
LogFactory.getLog(NotificationConfigurator.class);
+    private static final Logger log = 
Logger.getLogger(NotificationConfigurator.class);
     private Map<String, String> prop = null;
 
     public NotificationConfigurator() {
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java
index 3840265..b60cc3e 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java
@@ -8,8 +8,7 @@
 import java.util.Properties;
 import java.util.Set;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.notifier.NotificationServiceException;
 import org.ovirt.engine.core.utils.LocalConfig;
 
@@ -54,7 +53,7 @@
      */
     public static final String DAYS_TO_SEND_ON_STARTUP = 
"DAYS_TO_SEND_ON_STARTUP";
 
-    private static final Log log = 
LogFactory.getLog(NotificationProperties.class);
+    private static final Logger log = 
Logger.getLogger(NotificationProperties.class);
 
     // Default files for defaults and overridden values:
     private static String DEFAULTS_PATH = 
"/usr/share/ovirt-engine/conf/notifier.conf.defaults";
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/EventSenderMailImpl.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/EventSenderMailImpl.java
index 7900f7a..a733a2f 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/EventSenderMailImpl.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/EventSenderMailImpl.java
@@ -8,8 +8,7 @@
 import javax.mail.MessagingException;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.common.businessentities.EventAuditLogSubscriber;
 import org.ovirt.engine.core.notifier.utils.NotificationProperties;
 import org.ovirt.engine.core.notifier.utils.sender.EventSender;
@@ -30,7 +29,7 @@
  */
 public class EventSenderMailImpl implements EventSender {
 
-    private static final Log log = 
LogFactory.getLog(EventSenderMailImpl.class);
+    private static final Logger log = 
Logger.getLogger(EventSenderMailImpl.class);
     private JavaMailSender mailSender;
     private String hostName;
     private boolean isBodyHtml = false;
diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
index a3a60cd..5782d45 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/sender/mail/JavaMailSender.java
@@ -17,8 +17,7 @@
 import javax.mail.internet.MimeMessage;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 import org.ovirt.engine.core.notifier.utils.NotificationProperties;
 
 /**
@@ -26,7 +25,7 @@
  */
 public class JavaMailSender {
 
-    private static final Log log = LogFactory.getLog(JavaMailSender.class);
+    private static final Logger log = Logger.getLogger(JavaMailSender.class);
     private Session session = null;
     private InternetAddress from = null;
     private InternetAddress replyTo = null;
diff --git a/packaging/etc/notifier/log4j.xml.in 
b/packaging/etc/notifier/log4j.xml.in
index 7d4b087..9724157 100644
--- a/packaging/etc/notifier/log4j.xml.in
+++ b/packaging/etc/notifier/log4j.xml.in
@@ -25,14 +25,10 @@
     </appender>
 
     <root>
-        <priority value="ERROR" />
+        <priority value="INFO" />
         <!-- appender-ref ref="CONSOLE" /-->
         <appender-ref ref="FILE" />
     </root>
-
-    <logger name="org.ovirt.engine.core">
-        <level value="INFO"/>
-    </logger>
 
 </log4j:configuration>
 


--
To view, visit http://gerrit.ovirt.org/14377
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35de5d5a97ccd4f7bb80739fdb328de2e0ce6bd9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to