Move secure log4j logger declaration from security.ui to security.core in order to...
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 5 Mar 2012 14:38:24 +0000 (14:38 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 5 Mar 2012 14:38:24 +0000 (14:38 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@5150 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

security/plugins/org.argeo.security.ui/META-INF/spring/monitor.xml [deleted file]
security/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/AdminLogView.java
security/runtime/org.argeo.security.core/META-INF/spring/logger.xml [new file with mode: 0644]
security/runtime/org.argeo.security.core/META-INF/spring/osgi.xml [new file with mode: 0644]
security/runtime/org.argeo.security.core/pom.xml

diff --git a/security/plugins/org.argeo.security.ui/META-INF/spring/monitor.xml b/security/plugins/org.argeo.security.ui/META-INF/spring/monitor.xml
deleted file mode 100644 (file)
index 67f3599..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
-       <!-- Log4j appender singleton -->
-       <bean id="secureLogger" class="org.argeo.security.log4j.SecureLogger"
-               init-method="init" destroy-method="destroy">
-               <property name="configuration">
-                       <value><![CDATA[
-log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=DEBUG
-log4j.logger.org.argeo.jackrabbit.remote.ExtendedDispatcherServlet=WARN
-log4j.logger.org.argeo.server.webextender.TomcatDeployer=WARN
-log4j.logger.org.argeo.security.core=TRACE
-
-#log4j.logger.org.springframework.security=DEBUG
-
-log4j.logger.org.apache.catalina=INFO
-log4j.logger.org.apache.coyote=INFO
-log4j.logger.org.apache.directory.server=ERROR
-log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
-log4j.logger.org.apache.jackrabbit.core.config=ERROR
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yyMMdd HH:mm:ss} %-5p %m [%t] %c%n
-                       ]]></value>
-               </property>
-       </bean>
-</beans>
index 5e1433c2fa46d87c81dce5691874727a43fc95b7..1f93913de0d2324a83523b344afa3698ed63401d 100644 (file)
@@ -7,6 +7,7 @@
        http://www.springframework.org/schema/beans   \r
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
-       <!-- SERVICES -->\r
-       <service ref="secureLogger" interface="org.argeo.ArgeoLogger" />\r
+       <!-- REFERENCES -->\r
+       <reference id="secureLogger" interface="org.argeo.ArgeoLogger"\r
+               cardinality="0..1" />\r
 </beans:beans>
\ No newline at end of file
index 59b18e0a9054793f22d21fc543e4bda9ddc32979..4f6fb5a3568e9a6fa79f0fe03c14e56c96ad44e7 100644 (file)
@@ -2,7 +2,7 @@ package org.argeo.security.ui.views;
 
 import java.util.ArrayList;
 
-import org.argeo.security.log4j.SecureLogger;
+import org.argeo.ArgeoLogger;
 import org.argeo.security.ui.SecurityUiPlugin;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -22,7 +22,7 @@ public class AdminLogView extends ViewPart {
        private TableViewer viewer;
 
        private LogContentProvider logContentProvider;
-       private SecureLogger argeoLogger;
+       private ArgeoLogger argeoLogger;
 
        @Override
        public void createPartControl(Composite parent) {
@@ -66,7 +66,7 @@ public class AdminLogView extends ViewPart {
                        argeoLogger.unregisterForAll(logContentProvider);
        }
 
-       public void setArgeoLogger(SecureLogger argeoLogger) {
+       public void setArgeoLogger(ArgeoLogger argeoLogger) {
                this.argeoLogger = argeoLogger;
        }
 
diff --git a/security/runtime/org.argeo.security.core/META-INF/spring/logger.xml b/security/runtime/org.argeo.security.core/META-INF/spring/logger.xml
new file mode 100644 (file)
index 0000000..9e7a680
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+       <!-- Log4j appender singleton -->
+       <bean id="secureLogger" class="org.argeo.security.log4j.SecureLogger"
+               init-method="init" destroy-method="destroy">
+               <property name="configuration">
+                       <value><![CDATA[
+log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=DEBUG
+log4j.logger.org.argeo.jackrabbit.remote.ExtendedDispatcherServlet=ERROR
+log4j.logger.org.springframework.web.servlet.PageNotFound=ERROR
+log4j.logger.org.argeo.server.webextender.TomcatDeployer=WARN
+
+log4j.logger.org.apache.coyote=INFO
+log4j.logger.org.apache.catalina.core.ContainerBase=INFO
+log4j.logger.org.apache.directory.server=ERROR
+log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
+log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
+log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.ActiveMQMessageConsumer=INFO
+log4j.logger.org.apache.activemq.ActiveMQMessageProducer=INFO
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyMMdd HH:mm:ss} %-5p %m [%t] %c%n
+                       ]]></value>
+               </property>
+       </bean>
+</beans>
diff --git a/security/runtime/org.argeo.security.core/META-INF/spring/osgi.xml b/security/runtime/org.argeo.security.core/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..5e1433c
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <!-- SERVICES -->\r
+       <service ref="secureLogger" interface="org.argeo.ArgeoLogger" />\r
+</beans:beans>
\ No newline at end of file
index d751d5ebdc2c3cc85b717d13e74ffcc5d5e87a51..b030759189778faf9561e52c91e714cca01040ce 100644 (file)
@@ -29,6 +29,7 @@
 
                                <configuration>
                                        <instructions>
+                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
                                                <Export-Package>
                                                        org.argeo.security.*
                                                </Export-Package>