Author: bdelacretaz
Date: Mon Dec 3 06:44:46 2007
New Revision: 600558
URL: http://svn.apache.org/viewvc?rev=600558&view=rev
Log:
Less verbose logging, controlled by properties in pom.xml
Added:
incubator/sling/trunk/microsling/microsling-core/src/main/resources/
incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.dtd
- copied unchanged from r600531,
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.dtd
incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.xml
- copied, changed from r600531,
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.xml
Removed:
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.dtd
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.xml
Modified:
incubator/sling/trunk/microsling/microsling-core/pom.xml
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
Modified: incubator/sling/trunk/microsling/microsling-core/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/pom.xml?rev=600558&r1=600557&r2=600558&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/pom.xml (original)
+++ incubator/sling/trunk/microsling/microsling-core/pom.xml Mon Dec 3
06:44:46 2007
@@ -52,6 +52,12 @@
started. Useful to manually test the integration testing webapp.
-->
<integration.test.wait>false</integration.test.wait>
+
+ <!--
+ log levels
+ -->
+ <sling.log.level>info</sling.log.level>
+ <root.log.level>info</root.log.level>
</properties>
<dependencies>
@@ -97,7 +103,19 @@
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>test</scope>
+ <exclusions>
+ <!--
+ Same problem as JCR-683: commons-httpclient depends on
commons-logging. Since
+ this webapp uses log4j (see the slf4j-log4j12 dependency below), we
need to
+ override this dependency with jcl104-over-sflf4j, found below
+ -->
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<!-- Sling Scripting: This is a temporary solution until we have
implemented the lookup mechanism
for script engines in microsling. -->
<dependency>
@@ -120,9 +138,26 @@
<artifactId>org.apache.sling.scripting.ruby</artifactId>
<version>2.0.0-incubator-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ <version>1.3.0</version>
+ </dependency>
</dependencies>
<build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Copied:
incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.xml
(from r600531,
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.xml)
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.xml?p2=incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.xml&p1=incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.xml&r1=600531&r2=600558&rev=600558&view=diff
==============================================================================
---
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/log4j.xml
(original)
+++
incubator/sling/trunk/microsling/microsling-core/src/main/resources/log4j.xml
Mon Dec 3 06:44:46 2007
@@ -1,49 +1,48 @@
<?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.
- -->
+ 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.
+-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <!--
====================================================================== -->
- <!-- A P P E N D E R S
-->
- <!--
====================================================================== -->
+ <!-- console appender -->
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.err" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p*
%c{1}: %m (%F, line %L)%n" />
+ </layout>
+ </appender>
+
+ <!-- appender file -->
+ <appender name="file" class="org.apache.log4j.FileAppender">
+ <param name="File" value="logs/microsling.log" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p*
%c{1}: %m (%F, line %L)%n" />
+ </layout>
+ </appender>
- <!-- console -->
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss}
*%-5p* %c{1}: %m (%F, line %L)%n"/>
- </layout>
- </appender>
+ <!-- Sling stuff, to be able to set a different log level if needed -->
+ <logger name="org.apache.sling">
+ <level value="${sling.log.level}" />
+ </logger>
- <!-- log file -->
- <appender name="file" class="org.apache.log4j.FileAppender">
- <param name="File" value="logs/microsling.log"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss}
*%-5p* %c{1}: %m (%F, line %L)%n"/>
- </layout>
- </appender>
-
- <!--
====================================================================== -->
- <!-- C A T E G O R I E S
-->
- <!--
====================================================================== -->
- <category name="org.apache.sling">
- <priority value="debug"/>
- <appender-ref ref="console"/>
- <appender-ref ref="file"/>
- </category>
+ <root>
+ <level value="${root.log.level}" />
+ <appender-ref ref="file" />
+ <appender-ref ref="console" />
+ </root>
</log4j:configuration>
Modified:
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml?rev=600558&r1=600557&r2=600558&view=diff
==============================================================================
---
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
(original)
+++
incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
Mon Dec 3 06:44:46 2007
@@ -25,20 +25,6 @@
<display-name>Microsling Web Application</display-name>
<servlet>
- <servlet-name>Logging</servlet-name>
- <description>Configures the Log4J logging facility.</description>
- <servlet-class>org.apache.jackrabbit.j2ee.LoggingServlet</servlet-class>
-
- <init-param>
- <param-name>log4j-config</param-name>
- <param-value>/WEB-INF/log4j.xml</param-value>
- <description>initial log4j configuration</description>
- </init-param>
-
- <load-on-startup>10</load-on-startup>
- </servlet>
-
- <servlet>
<servlet-name>JackrabbitRepository</servlet-name>
<description>
Creates a Jackrabbit repository (or opens it if already created) and
makes it available as