logback-dev
Threads by month
- ----- 2025 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 9940 discussions

svn commit: r895 - in logback/trunk: logback-examples/src/main/java/chapter4 logback-examples/src/main/java/chapter4/socket logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 10 Nov '06
by noreply.seb@qos.ch 10 Nov '06
10 Nov '06
Author: seb
Date: Fri Nov 10 18:32:03 2006
New Revision: 895
Modified:
logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java
logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java
logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient1.java
logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
corrected some imports. Unfortunately, we sometimes _have_ to import logback's logger
and not slf4j's logger class.
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java Fri Nov 10 18:32:03 2006
@@ -13,9 +13,9 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.WriterAppender;
import ch.qos.logback.core.layout.EchoLayout;
@@ -33,6 +33,8 @@
writerAppender.setWriter(new OutputStreamWriter(os));
writerAppender.setImmediateFlush(false);
writerAppender.start();
+ Logger root = lc.getLogger(LoggerContext.ROOT_NAME);
+ root.addAppender(writerAppender);
Logger logger = lc.getLogger(ExitWoes1.class);
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java Fri Nov 10 18:32:03 2006
@@ -13,12 +13,13 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.WriterAppender;
import ch.qos.logback.core.layout.EchoLayout;
+import ch.qos.logback.core.util.StatusPrinter;
public class ExitWoes2 {
@@ -33,11 +34,15 @@
writerAppender.setWriter(new OutputStreamWriter(os));
writerAppender.setImmediateFlush(false);
writerAppender.start();
+ Logger root = lc.getLogger(LoggerContext.ROOT_NAME);
+ root.addAppender(writerAppender);
Logger logger = lc.getLogger(ExitWoes2.class);
logger.debug("Hello world.");
lc.shutdownAndReset();
+
+ StatusPrinter.print(lc);
}
}
\ No newline at end of file
Modified: logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient1.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient1.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient1.java Fri Nov 10 18:32:03 2006
@@ -13,9 +13,9 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
-import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.net.SocketAppender;
@@ -55,8 +55,8 @@
// of the next statement.
socketAppender.start();
- Logger logger = LoggerFactory.getLogger(SocketClient1.class);
- //logger.addAppender(socketAppender);
+ Logger logger = (Logger) LoggerFactory.getLogger(SocketClient1.class);
+ logger.addAppender(socketAppender);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Modified: logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java Fri Nov 10 18:32:03 2006
@@ -28,7 +28,7 @@
public class SocketClient2 {
static void usage(String msg) {
System.err.println(msg);
- System.err.println("Usage: java " + SocketClient1.class.getName() +
+ System.err.println("Usage: java " + SocketClient2.class.getName() +
" configFile\n" +
" configFile a logback configuration file" +
" in XML format.");
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml Fri Nov 10 18:32:03 2006
@@ -1377,6 +1377,7 @@
<RemoteHost>${host}</RemoteHost>
<Port>${port}</Port>
<ReconnectionDelay>10000</ReconnectionDelay>
+ <IncludeCallerData>${includeCallerData}</IncludeCallerData>
</appender>
<root>
1
0

svn commit: r894 - in logback/trunk: logback-examples/src/main/java/chapter4 logback-examples/src/main/java/chapter4/db logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 10 Nov '06
by noreply.seb@qos.ch 10 Nov '06
10 Nov '06
Author: seb
Date: Fri Nov 10 17:40:52 2006
New Revision: 894
Modified:
logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java
logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
supressed unnecessary elements in DB configuration examples
minor fixes
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java Fri Nov 10 17:40:52 2006
@@ -14,7 +14,7 @@
*
* This class can be used to check the result of a configuration file.
* <p>
- * When all the logback-core, logback-classic and their dependencies have been
+ * When all the logback-core, logback-classic, logback-examples and their dependencies have been
* added to the ClassPath, one can launch this class using the following
* command:
* <p>
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml Fri Nov 10 17:40:52 2006
@@ -26,10 +26,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
<root>
<level value ="debug"/>
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml Fri Nov 10 17:40:52 2006
@@ -13,14 +13,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran">
- <level value="INFO" />
- </logger>
- <logger name="ch.qos.logback.classic.joran">
- <level value="INFO" />
- </logger>
-
<root>
<level value="debug" />
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml Fri Nov 10 17:40:52 2006
@@ -13,11 +13,6 @@
</dataSource>
</connectionSource>
</appender>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
<root>
<level value="debug" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml Fri Nov 10 17:40:52 2006
@@ -11,10 +11,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
<root>
<level value="debug" />
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml Fri Nov 10 17:40:52 2006
@@ -24,12 +24,6 @@
</connectionSource>
</appender>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
-
<root>
<level value ="debug"/>
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml Fri Nov 10 17:40:52 2006
@@ -19,11 +19,7 @@
<password>${password}</password>
</connectionSource>
</appender>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
+
<root>
<level value ="debug"/>
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml Fri Nov 10 17:40:52 2006
@@ -12,10 +12,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
<root>
<level value="debug" />
<appender-ref ref="DB" />
Modified: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml Fri Nov 10 17:40:52 2006
@@ -23,10 +23,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
<root>
<level value ="debug"/>
<appender-ref ref="DB" />
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml Fri Nov 10 17:40:52 2006
@@ -386,11 +386,13 @@
</configuration></pre></div>
<p>
- To run this example, use the provided <code>ConfigurationTester</code> by
- issuing the following command, once in the <em>logback-examples/target/classes</em>:
+ To run this example, as well as others in this
+ chapter, please add the <em>logback-examples-VERSION.hjar</em> to your classpath.
+ Then, use the provided <code>ConfigurationTester</code> by
+ issuing the following command, once in the <em>logback-examples</em> directory:
</p>
-<div class="source"><pre>java chapter4.ConfigurationTester chapter4/conf/logback-Console.xml</pre></div>
+<div class="source"><pre>java chapter4.ConfigurationTester src/main/java/chapter4/conf/logback-Console.xml</pre></div>
<a name="FileAppender" />
<h3>FileAppender</h3>
@@ -522,7 +524,7 @@
issuing the following command, once in the <em>logback-examples/target/classes</em>:
</p>
-<div class="source"><pre>java chapter4.ConfigurationTester chapter4/conf/logback-fileAppender.xml</pre></div>
+<div class="source"><pre>java chapter4.ConfigurationTester src/main/java/chapter4/conf/logback-fileAppender.xml</pre></div>
<a name="RollingFileAppender" />
@@ -646,7 +648,7 @@
renames files according to a fixed window algorithm as described below.
</p>
<p>
- The <span class="option">File</span>> option, which is configured in the
+ The <span class="option">File</span> option, which is configured in the
<code>FileAppender</code> element, is required. It represents the name of the file
where current logging output will be written. The <span class="option">FileNamePattern</span>
option represents the file name pattern for the archived (rolled over) log files.
@@ -1192,6 +1194,10 @@
<a name="Classic"/>
<h2>Logback Classic</h2>
+
+
+ <p>While logging event are declared as <code>Object</code> in logback core,
+ they are instances of the <code>LoggingEvent</code> class in logback classic.</p>
<a name="SocketAppender" />
<h3>SockerAppender</h3>
@@ -1200,7 +1206,7 @@
The appenders covered this far were only able to log to local resources.
In contrast, the <a href="../xref/ch/qos/logback/classic/net/SocketAppender.html">
<code>SocketAppender</code></a> is designed to log to a
- remote entity by transmitting serialized LoggingEvent objects over the wire.
+ remote entity by transmitting serialized <code>LoggingEvent</code> objects over the wire.
Remote logging is non-intrusive as far as the logging event is concerned.
On the receiving end after de-serialization, the event can be logged as
if it were generated locally. Multiple <code>SocketAppender</code> instances
@@ -1314,12 +1320,12 @@
</p>
<p>
- Assuming you are in the <em>logback-examples/target/classes/</em> directory,
+ Assuming you are in the <em>logback-examples/</em> directory,
start <code>SimpleSocketServer</code> with the following command:
</p>
<div class="source"><pre>java ch.qos.logback.classic.net.SimpleSocketServer 6000 \
- chapter4/socket/server1.xml
+ src/main/java/chapter4/socket/server1.xml
</pre></div>
<p>
@@ -1390,7 +1396,7 @@
</p>
<div class="source"><pre>java -Dhost=localhost -Dport=6000 -DincludeCallerData=false \
- chapter4.socket.SocketClient2 chapter4/socket/client1.xml
+ chapter4.socket.SocketClient2 src/main/java/chapter4/socket/client1.xml
</pre></div>
<p>
@@ -1409,7 +1415,7 @@
</p>
<div class="source"><pre> java ch.qos.logback.classic.net.SimpleSocketServer 6000 \
- chapter4/socket/server2.xml
+ src/main/java/chapter4/socket/server2.xml
</pre></div>
<p>
@@ -1430,7 +1436,7 @@
</p>
<div class="source"><pre>java -Dhost=localhost -Dport=6000 -DincludeCallerData=true \
- chapter4.socket.SocketClient2 chapter4/socket/client1.xml
+ chapter4.socket.SocketClient2 src/main/java/chapter4/socket/client1.xml
</pre></div>
<p>
@@ -1994,11 +2000,7 @@
<password>password</password>
</connectionSource>
</appender></b>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
+
<root>
<level value="debug" />
<appender-ref ref="DB" />
@@ -2082,11 +2084,7 @@
<password>${password}</password>
</connectionSource>
</appender>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
- <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
-
+
<root>
<level value ="debug"/>
<appender-ref ref="DB" />
@@ -2190,14 +2188,6 @@
</dataSource>
</connectionSource>
</appender>
-
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran">
- <level value="INFO" />
- </logger>
- <logger name="ch.qos.logback.classic.joran">
- <level value="INFO" />
- </logger>
<root>
<level value="debug" />
@@ -2235,14 +2225,6 @@
</connectionSource>
</appender>
- <!-- Prevent internal logback DEBUG messages from polluting the output. -->
- <logger name="ch.qos.logback.core.joran">
- <level value="INFO" />
- </logger>
- <logger name="ch.qos.logback.classic.joran">
- <level value="INFO" />
- </logger>
-
<root>
<level value="debug" />
<appender-ref ref="DB" />
1
0

svn commit: r893 - in logback/trunk: logback-examples/src/main/java/chapter4/conf logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 10 Nov '06
by noreply.seb@qos.ch 10 Nov '06
10 Nov '06
Author: seb
Date: Fri Nov 10 15:58:25 2006
New Revision: 893
Added:
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingFixedWindow.xml
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml
Modified:
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingSizeBased.xml
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingTimeBased.xml
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
on going work
Added: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingFixedWindow.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingFixedWindow.xml Fri Nov 10 15:58:25 2006
@@ -0,0 +1,22 @@
+<configuration>
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <File>testFile.log</File>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <FileNamePattern>testFile.%i.log.zip</FileNamePattern>
+ <MinIndex>1</MinIndex>
+ <MaxIndex>3</MaxIndex>
+ </rollingPolicy>
+
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <MaxFileSize>5MB</MaxFileSize>
+ </triggeringPolicy>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
+ </layout>
+ </appender>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="FILE" />
+ </root>
+</configuration>
\ No newline at end of file
Modified: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingSizeBased.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingSizeBased.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingSizeBased.xml Fri Nov 10 15:58:25 2006
@@ -13,7 +13,7 @@
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
Modified: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingTimeBased.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingTimeBased.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-RollingTimeBased.xml Fri Nov 10 15:58:25 2006
@@ -6,7 +6,7 @@
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
Added: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml Fri Nov 10 15:58:25 2006
@@ -0,0 +1,20 @@
+<configuration>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <File>testFile.log</File>
+ <Append>true</Append>
+ <Encoding>UTF-8</Encoding>
+ <BufferedIO>false</BufferedIO>
+ <ImmediateFlush>true</ImmediateFlush>
+
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
+ </layout>
+ </appender>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="FILE" />
+ </root>
+</configuration>
+
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml Fri Nov 10 15:58:25 2006
@@ -14,7 +14,6 @@
Authors: Ceki Gülcü, Sébastien Pennec
</div>
-
<table>
<tr>
<td valign="top" align="top">
@@ -104,13 +103,10 @@
such as methods for getting or setting their name, their started status,
their layout and their filters.
It is the super-class of all appenders shipped with logback.
- Although an abstract class, AppenderBase actually implements the
+ Although an abstract class, <code>AppenderBase</code> actually implements the
<code>doAppend()</code> method in the <code>Append</code> interface.
- Perhaps the clearest way to discuss AppenderBase class is by
+ Perhaps the clearest way to discuss <code>AppenderBase</code> class is by
presenting a bit of its actual source code.
- <code>AppenderBase</code>'s complete source code is also
- <a href="../xref/ch/qos/logback/core/AppenderBase.html">
- available for viewing</a>.
</p>
<div class="source"><pre>public synchronized void doAppend(Object eventObject) {
@@ -155,30 +151,28 @@
<p>
The first thing the <code>doAppend()</code> method does is to set the
<code>guard</code> variable to <code>true</code>. This ensures that the method will not
- call itself and create an infinite loop. Why could it call itself, you might ask? Well,
- just imagine that a logback component, called somewhere beyond the <code>append()</code>
- method, might want to log something. Its call could be directed to the very same appender
+ call itself and create an infinite loop. Just imagine that a component, called somewhere
+ beyond the <code>append()</code>
+ method, wants to log something. Its call could be directed to the very same appender
that just called it, which would then call it again.
</p>
<p>
The first statement of the <code>doAppend()</code> method, once the <code>try</code> block
- is reached is to check whether the <code>started</code> field is true.
+ is reached, is to check whether the <code>started</code> field is true.
If it is not, <code>doAppend()</code> will send a warning message and return.
In other words, once stopped, it is impossible to write to a closed appender.
- <code>Appender</code> object implement the <code>LifeCycle</code> interface,
+ <code>Appender</code> objects implement the <code>LifeCycle</code> interface,
which implies that they implement <code>start()</code>, <code>stop()</code>
and <code>isStarted()</code> methods. After setting all the options of an appender,
- Joran, logback's configuration framework, calls this method to signal the appender
- to bind or activate its options.
+ Joran, logback's configuration framework, calls the <code>start()</code>
+ method to signal the appender to bind or activate its options.
Indeed, depending on the appender, certain options cannot be activated because
of interferences with other options, or appenders can even not start at all if
some options are missing.
For example, since file creation depends on truncation mode,
<code>FileAppender</code> cannot act on the value of its <code>File</code> option
until the value of the Append option is also known for certain.
- Sub-classes of <code>AppenderBase</code> are required to set the boolean variable
- <code>started</code> to false when their <code>stop()</code> method is invoked.
</p>
<p>
@@ -192,8 +186,8 @@
<p>
The next <code>if</code> statement checks the result
of the attached <code>Filter</code> objects.
- Depending on the decision made by the filters
- in the filter chain, events can be denied or alternatively accepted.
+ Depending on the decision resulting from the filter chain, events can be denied or
+ alternatively accepted.
In the absence of a decision by the filter chain, events are accepted by default.
</p>
@@ -242,7 +236,8 @@
required to support at least the following encodings:
<em>US-ASCII</em>, <em>ISO-8859-1</em>, <em>UTF-8</em>, <em>UTF-16BE</em>,
<em>UTF-16LE</em> and <em>UTF-16</em>.
- By default, the <span class="option">Encoding</span> option is null such
+ By default, the <span class="option">Encoding</span> option is
+ <code>null</code> such
that the platform's default encoding is used.
</td>
</tr>
@@ -315,7 +310,8 @@
running <code>ExitWoes1</code> will not produce any output in the file
<em>exitWoes1.log</em>
because the Java VM does not flush output streams when it exits.
- Calling the <code>reset()</code> method of a <code>LoggerContext</code> ensures that all
+ Calling the <code>shutdownAndReset()</code> method of a <code>LoggerContext</code>
+ ensures that all
appenders in the hierarchy are closed and their buffers are flushed. The
<code>ExitWoes2</code> class uses this statement and outputs a logging
request. <b>DOES NOT WORK ??</b>
@@ -368,6 +364,34 @@
</td>
</tr>
</table>
+
+ <p>
+ Here is a sample configuration that uses <code>ConsoleAppender</code>.
+ </p>
+
+<em>Example 4.2: ConsoleAppender configuration (logback-examples/src/main/java/chapter4/conf/logback-Console.xml)</em>
+<div class="source"><pre><configuration>
+
+ <b><appender name="STDOUT"
+ class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%-4relative [%thread] %-5level - %msg %n</Pattern>
+ </layout>
+ </appender></b>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration></pre></div>
+
+ <p>
+ To run this example, use the provided <code>ConfigurationTester</code> by
+ issuing the following command, once in the <em>logback-examples/target/classes</em>:
+ </p>
+
+<div class="source"><pre>java chapter4.ConfigurationTester chapter4/conf/logback-Console.xml</pre></div>
+
<a name="FileAppender" />
<h3>FileAppender</h3>
@@ -439,6 +463,13 @@
The <span class="option">File</span> option has no default value.
</td>
</tr>
+ <tr>
+ <td><b><span class="option">ImmediateFlush</span></b></td>
+ <td><code>boolean</code></td>
+ <td>
+ See <code>WriterAppender</code> options.
+ </td>
+ </tr>
</table>
<p>
@@ -456,12 +487,44 @@
I/O buffering (<span class="option">ImmediateFlush</span>=false).
Performance varies somewhat depending on the host machine as well as JDK version.
Throughput measurements are based on the <code>chapter4.IO</code> application.
- Please refer to the file <em>logback-examples/src/main/java/chapter4/IO.java</em>
+ Please refer to <a href="../xref/chapter4/IO.html">
+ <em>logback-examples/src/main/java/chapter4/IO.java</em></a>
for actual source code.
- <a href="../xref/chapter4/IO.html">Online viewing</a>
- of this file is also available.
</p>
+ <p>
+ Configuring <code>FileAppender</code> can be done the following way:
+ </p>
+
+<em>Example 4.3: FileAppender configuration (logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml)</em>
+<div class="source"><pre><configuration>
+
+ <b><appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <File>testFile.log</File>
+ <Append>true</Append>
+ <Encoding>UTF-8</Encoding>
+ <BufferedIO>false</BufferedIO>
+ <ImmediateFlush>true</ImmediateFlush>
+
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
+ </layout>
+ </appender></b>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="FILE" />
+ </root>
+</configuration></pre></div>
+
+ <p>
+ To run this example, use the provided <code>ConfigurationTester</code> by
+ issuing the following command, once in the <em>logback-examples/target/classes</em>:
+ </p>
+
+<div class="source"><pre>java chapter4.ConfigurationTester chapter4/conf/logback-fileAppender.xml</pre></div>
+
+
<a name="RollingFileAppender" />
<h3>RollingFileAppender</h3>
@@ -475,7 +538,7 @@
<p>
There are two important logback componenents that interact with
<code>RollingFileAppender</code>. First, <code>RollingPolicy</code>
- implementation define the procedure that will be followed when
+ implementations define the procedure that will be followed when
the rollover happens. The second componenent is
<code>TriggeringPolicy</code> implementations that are used
to check wether the rollover must happen or not at a given time.
@@ -514,17 +577,17 @@
</tr>
<tr>
<td><b><span class="option">Encoding</span></b></td>
- <td><code>int</code></td>
+ <td><code>String</code></td>
<td>See <code>WriterAppender</code> options.</td>
</tr>
<tr>
<td><b><span class="option">File</span></b></td>
- <td><code>int</code></td>
+ <td><code>String</code></td>
<td>See <code>FileAppender</code> options.</td>
</tr>
<tr>
<td><b><span class="option">ImmediateFlush</span></b></td>
- <td><code>int</code></td>
+ <td><code>boolean</code></td>
<td>See <code>WriterAppender</code> options.</td>
</tr>
<tr>
@@ -562,8 +625,7 @@
public interface RollingPolicy extends LifeCycle {
-
- public void rollover() throws RolloverFailure;
+ <b>public void rollover() throws RolloverFailure;</b>
public String getNewActiveFileName();
public void setParent(FileAppender appender);
}</pre></div>
@@ -584,11 +646,11 @@
renames files according to a fixed window algorithm as described below.
</p>
<p>
- The <b>File</b> property, which is configured in the
+ The <span class="option">File</span>> option, which is configured in the
<code>FileAppender</code> element, is required. It represents the name of the file
- where current logging output will be written. The <b>FileNamePattern</b>
+ where current logging output will be written. The <span class="option">FileNamePattern</span>
option represents the file name pattern for the archived (rolled over) log files.
- The <b>FileNamePattern</b> option, which is also required, must include
+ The <span class="option">FileNamePattern</span> option, which is also required, must include
an integer token, that is the string <em>%i</em>
somewhere within the pattern.
</p>
@@ -662,7 +724,7 @@
We suppose that the <span class="option">MinIndex</span> is set to <em>1</em> and
<span class="option">MaxIndex</span> is set to <em>3</em>. The
<span class="option">FileNamePattern</span> option is set to <em>foo%i.log</em>, and
- the <code>FileAppender</code>'s <span class="option">FileNamePattern</span>
+ the <span class="option">FileNamePattern</span>
option is set to <em>foo.log</em>.
</p>
@@ -753,7 +815,7 @@
foo3.log, foo2.log, foo1.log
</td>
<td>
- At the fourth rollover, the old <em>foo3.log</em> file is deleted. The files
+ From the fourth rollover, the old <em>foo3.log</em> file is deleted. The files
are all renamed with an increment to their index, and a new <em>foo.log</em>
file is created and used for the output.
From this moment on, there will always be 4 log files available, each being present
@@ -766,6 +828,9 @@
Here is a sample configuration to use <code>RollingFileAppender</code>
and <code>FixedWindowRollingPolicy</code>.
</p>
+
+<em>Example 4.4: Sample configuration of a <code>RollingFileAppender</code> using a
+<code>FixedWindowRollingPolicy</code> (logback-examples/src/main/java/chapter4/conf/logback-RollingFixedWindow.xml)</em>
<div class="source"><pre><configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>testFile.log</File>
@@ -779,7 +844,7 @@
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
@@ -958,7 +1023,7 @@
Given the use of the <span class="option">FileNamePattern</span>, we see that the
<code>TimeBasedRollingPolicy</code> is responsible for the rollover as well as for
the triggering of said rollover. Therefore, <code>TimeBasedTriggeringPolicy</code>
- implements <code>RollingPolicy</code> as well as <code>TriggeringPolicy</code>
+ implements both <code>RollingPolicy</code> and <code>TriggeringPolicy</code>
interfaces. A <code>RollingFileAppender</code> that uses
<code>TimeBasedRollingPolicy</code> can be started and used correctly even
if its configuration does not contain any reference to a <code>TriggeringPolicy</code>.
@@ -1002,6 +1067,8 @@
uses a <code>TimeBasedRollingPolicy</code>
</p>
+<em>Example 4.5: Sample configuration of a <code>RollingFileAppender</code> using a
+<code>TimeBasedRollingPolicy</code> (logback-examples/src/main/java/chapter4/conf/logback-RollingTimeBased.xml)</em>
<div class="source"><pre><configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>logFile.log</File>
@@ -1010,7 +1077,7 @@
</rollingPolicy></b>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
@@ -1036,14 +1103,14 @@
public interface TriggeringPolicy extends LifeCycle {
- public boolean isTriggeringEvent(final File file, final Object event);
+ <b>public boolean isTriggeringEvent(final File file, final Object event);</b>
}</pre></div>
<p>
The
<code>isTriggeringEvent()</code>
method takes the active file, and the currently processed
- logging event. It's implementation decied, based on these
+ logging event. It's implementation decides, based on these
parameters, whether the rollover must occur or not, by
returning a boolean value.
</p>
@@ -1082,6 +1149,8 @@
using a <code>SizeBasedTriggeringPolicy</code>.
</p>
+<em>Example 4.6: Sample configuration of a <code>RollingFileAppender</code> using a
+<code>SizeBasedTriggeringPolicy</code> (logback-examples/src/main/java/chapter4/conf/logback-RollingSizeBased.xml)</em>
<div class="source"><pre><configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>testFile.log</File>
@@ -1095,7 +1164,7 @@
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy></b>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern>
+ <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
@@ -1121,14 +1190,9 @@
with a <code>Level</code> of <em>ERROR</em> or more is issued.
</p>
-
-
<a name="Classic"/>
<h2>Logback Classic</h2>
-
- <p><b>Keep this??</b>While logging event are declared as <code>Object</code> in logback core,
- they are instances of the <code>LoggingEvent</code> class in logback classic.</p>
-
+
<a name="SocketAppender" />
<h3>SockerAppender</h3>
@@ -1181,7 +1245,7 @@
pipe which may be lost. This is a common problem on Windows based systems.
To avoid lost data, it is usually sufficient to <code>close()</code> the
<code>SocketAppender</code> either explicitly or by calling the
- <code>LoggerContext</code>'s <code>reset()</code> method before exiting the application.
+ <code>LoggerContext</code>'s <code>shutdownAndReset()</code> method before exiting the application.
</p>
<p>
@@ -1300,7 +1364,7 @@
and attaches it to the root logger.
</p>
- <em>Example 4.2: SocketAppender configuration (logback-examples/src/main/java/chapter4/socket/client1.xml)</em>
+ <em>Example 4.7: SocketAppender configuration (logback-examples/src/main/java/chapter4/socket/client1.xml)</em>
<div class="source"><pre><configuration>
<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
@@ -1499,7 +1563,7 @@
Here is a sample configuration file you can supply to chapter4.mail.Email:
</p>
-<em>Example 4.3: A sample <code>SMTPAppender</code> configuration (logback-examples/src/main/java/chapter4/mail/mail1.xml)</em>
+<em>Example 4.8: A sample <code>SMTPAppender</code> configuration (logback-examples/src/main/java/chapter4/mail/mail1.xml)</em>
<div class="source"><pre><configuration>
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
@@ -1584,7 +1648,7 @@
every 1024th event triggers an email message.
</p>
-<em>Example 4.4: A <code>TriggeringPolicy</code> implementation
+<em>Example 4.9: A <code>TriggeringPolicy</code> implementation
that triggers every 1024th event (<a href="../xref/chapter4/mail/CounterBasedTP.html">logback-examples/src/main/java/chapter4/mail/CounterBasedTP.java</a>)</em>
<div class="source"><pre>package chapter4.mail;
@@ -1624,7 +1688,7 @@
as its triggering event evaluator.
</p>
-<em>Example 4.5: <code>SMTPAppender</code> with custom
+<em>Example 4.10: <code>SMTPAppender</code> with custom
<code>TriggeringPolicy</code> and buffer size (logback-examples/src/main/java/chapter4/mail/mail3.xml)</em>
<div class="source"><pre><configuration>
@@ -1919,7 +1983,7 @@
The following configuration file is what one would need.
</p>
-<em>Example 4.6: <code>DBAppender</code> configuration (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml)</em>
+<em>Example 4.11: <code>DBAppender</code> configuration (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml)</em>
<div class="source"><pre><configuration>
<b><appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
@@ -1998,7 +2062,7 @@
<code>javax.sql.DataSource</code>.
</p>
-<em>Example 4.7: <code>DBAppender</code> configuration (logback-examples/src/main/java/chapter4/db/append-with-datasource.xml)</em>
+<em>Example 4.12: <code>DBAppender</code> configuration (logback-examples/src/main/java/chapter4/db/append-with-datasource.xml)</em>
<div class="source"><pre><configuration>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
@@ -2112,7 +2176,7 @@
configuration file, logging events are sent to a MySQL database,
without any pooling.
</p>
-<em>Example 4.8: <code>DBAppender</code> configuration without pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml)</em>
+<em>Example 4.13: <code>DBAppender</code> configuration without pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml)</em>
<div class="source"><pre><configuration>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
@@ -2155,7 +2219,7 @@
in the classpath.
</p>
-<em>Example 4.8: <code>DBAppender</code> configuration with pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml)</em>
+<em>Example 4.14: <code>DBAppender</code> configuration with pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml)</em>
<div class="source"><pre><configuration>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
@@ -2298,6 +2362,7 @@
Here is a sample configuration using a <code>SyslogAppender</code>.
</p>
+<em>Example 4.15: <code>SyslogAppender</code> configuration (logback-examples/src/main/java/chapter4/conf/logback-syslog.xml)</em>
<div class="source"><pre><configuration>
<appender name="SYSLOG"
1
0

10 Nov '06
Author: seb
Date: Fri Nov 10 11:07:46 2006
New Revision: 892
Modified:
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java
logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java
logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java
logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java
logback/trunk/logback-examples/src/main/java/chapter4/mail/EMail.java
logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java
Log:
renamed LoggerContext's reset() method to shutdownAndReset()
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java Fri Nov 10 11:07:46 2006
@@ -163,7 +163,7 @@
return loggerContextRemoteView;
}
- public void reset() {
+ public void shutdownAndReset() {
root.recursiveReset();
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java Fri Nov 10 11:07:46 2006
@@ -92,7 +92,7 @@
if (configFile.endsWith(".xml")) {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
- lc.reset();
+ lc.shutdownAndReset();
configurator.setContext(lc);
configurator.doConfigure(configFile);
//StatusPrinter.print(lc);
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java Fri Nov 10 11:07:46 2006
@@ -38,7 +38,7 @@
assertTrue(appender instanceof ConsoleAppender);
}
{
- lc.reset();
+ lc.shutdownAndReset();
Appender appender = root.getAppender("STDOUT");
assertNull(appender);
}
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ConfigurationTester.java Fri Nov 10 11:07:46 2006
@@ -32,7 +32,7 @@
try {
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(lc);
- lc.reset();
+ lc.shutdownAndReset();
configurator.doConfigure(args[0]);
} catch (JoranException je) {
je.printStackTrace();
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes1.java Fri Nov 10 11:07:46 2006
@@ -24,7 +24,7 @@
public static void main(String[] args) throws Exception {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.reset();//this is to cancel default-config.
+ lc.shutdownAndReset();//this is to cancel default-config.
WriterAppender writerAppender = new WriterAppender();
writerAppender.setContext(lc);
writerAppender.setLayout(new EchoLayout());
Modified: logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/ExitWoes2.java Fri Nov 10 11:07:46 2006
@@ -24,7 +24,7 @@
public static void main(String[] args) throws Exception {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.reset();//this is to cancel default-config.
+ lc.shutdownAndReset();//this is to cancel default-config.
WriterAppender writerAppender = new WriterAppender();
writerAppender.setContext(lc);
writerAppender.setLayout(new EchoLayout());
@@ -38,6 +38,6 @@
logger.debug("Hello world.");
- lc.reset();
+ lc.shutdownAndReset();
}
}
\ No newline at end of file
Modified: logback/trunk/logback-examples/src/main/java/chapter4/mail/EMail.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/mail/EMail.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/mail/EMail.java Fri Nov 10 11:07:46 2006
@@ -35,7 +35,7 @@
if (configFile.endsWith(".xml")) {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
- lc.reset();
+ lc.shutdownAndReset();
configurator.setContext(lc);
configurator.doConfigure(configFile);
//StatusPrinter.print(lc);
Modified: logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/socket/SocketClient2.java Fri Nov 10 11:07:46 2006
@@ -45,7 +45,7 @@
if (configFile.endsWith(".xml")) {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
- lc.reset();
+ lc.shutdownAndReset();
configurator.setContext(lc);
configurator.doConfigure(configFile);
}
1
0

svn commit: r891 - logback/trunk/logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 10 Nov '06
by noreply.seb@qos.ch 10 Nov '06
10 Nov '06
Author: seb
Date: Fri Nov 10 10:32:01 2006
New Revision: 891
Modified:
logback/trunk/logback-site/src/site/xdocTemplates/manual/index.xml
Log:
minor fix
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/index.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/index.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/index.xml Fri Nov 10 10:32:01 2006
@@ -47,7 +47,7 @@
<p>The logback manual describes the logback API in considerable
detail, including its features and design rationale. Authored by
- Ceki Ceki Gülcü and Sébastien Pennec, the main
+ Ceki Gülcü and Sébastien Pennec, the main
contributors to the logback project, the logback manual is
intended for developers already familiar with the Java language
but new to logback, as much as for experienced logback users. With
1
0

svn commit: r890 - logback/trunk/logback-examples/src/main/java/chapter4/conf
by noreply.seb@qos.ch 09 Nov '06
by noreply.seb@qos.ch 09 Nov '06
09 Nov '06
Author: seb
Date: Thu Nov 9 17:23:01 2006
New Revision: 890
Modified:
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
Log:
syslog config tested
Modified: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml Thu Nov 9 17:23:01 2006
@@ -1,15 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="SYSLOG"
class="ch.qos.logback.classic.net.SyslogAppender">
- <SyslogHost>pixie</SyslogHost>
- <Facility>AUTH</Facility>
+ <SyslogHost>${syslogHost}</SyslogHost>
+ <Facility>${facility}</Facility>
<SuffixPattern>%-4relative [%thread] %-5level - %msg</SuffixPattern>
</appender>
-
- <root>
- <level value="debug" />
- <appender-ref ref="STDOUT" />
- </root>
+
+ <root>
+ <level value="DEBUG" />
+ <appender-ref ref="SYSLOG" />
+ </root>
</configuration>
1
0
Online report : http://localhost:8090/continuum/servlet/continuum/target/ProjectBuild.vm/vi…
Build statistics:
State: Ok
Previous State: Failed
Started at: Thu, 9 Nov 2006 17:20:40 +0100
Finished at: Thu, 9 Nov 2006 17:20:49 +0100
Total time: 8s
Build Trigger: Forced
Exit code: 0
Building machine hostname: pixie
Operating system : Linux(unknown)
Java version : 1.5.0_08(Sun Microsystems Inc.)
Changes
seb on going work on chapter 4
- SyslogAppender config (yet to be tested in real life)
- Modified SyslogAppenderTest, progress need to be done here, on testWithExceptions
/logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java
/logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml (from /logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml:883)
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
/logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
seb first draft of pooling test results
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml
/logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
****************************************************************************
Output:
****************************************************************************
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Logback Examples Module
[INFO] task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/50/target
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/50/target/classes
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/50/target/test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 38 source files to /opt/continuum-1.0.3/apps/continuum/working-directory/50/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar: /opt/continuum-1.0.3/apps/continuum/working-directory/50/target/logback-examples-0.6-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing /opt/continuum-1.0.3/apps/continuum/working-directory/50/target/logback-examples-0.6-SNAPSHOT.jar to /root/.m2/repository/ch/qos/logback/logback-examples/0.6-SNAPSHOT/logback-examples-0.6-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Nov 09 17:20:49 CET 2006
[INFO] Final Memory: 13M/116M
[INFO] ------------------------------------------------------------------------
****************************************************************************
1
0
Online report : http://localhost:8090/continuum/servlet/continuum/target/ProjectBuild.vm/vi…
Build statistics:
State: Ok
Previous State: Failed
Started at: Thu, 9 Nov 2006 17:20:14 +0100
Finished at: Thu, 9 Nov 2006 17:20:31 +0100
Total time: 16s
Build Trigger: Forced
Exit code: 0
Building machine hostname: pixie
Operating system : Linux(unknown)
Java version : 1.5.0_08(Sun Microsystems Inc.)
Changes
seb on going work on chapter 4
- SyslogAppender config (yet to be tested in real life)
- Modified SyslogAppenderTest, progress need to be done here, on testWithExceptions
/logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java
/logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml (from /logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml:883)
/logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
/logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
****************************************************************************
Output:
****************************************************************************
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Logback Classic Module
[INFO] task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/46/target
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/classes
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 70 source files to /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
Compiling 61 source files to /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running ch.qos.logback.classic.net.LoggingEventSerializationTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.086 sec
Running ch.qos.logback.classic.control.CLCTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running ch.qos.logback.classic.LoggerContextTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.073 sec
Running ch.qos.logback.classic.pattern.ClassNameAbbreviatorTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec
Running ch.qos.logback.classic.pattern.MDCConverterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec
Running ch.qos.logback.classic.MDCTest
Exiting a
Exiting b
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec
Running ch.qos.logback.classic.BasicLoggerTest
|-WARN in ch.qos.logback.core.appender.ListAppender[null] - Attempted to append to non started appender [null].
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec
Running ch.qos.logback.classic.PatternLayoutTest
=========
testNullPattern
|-ERROR in ch.qos.logback.classic.PatternLayout(null) - Failed to parse pattern "null". ch.qos.logback.core.pattern.parser.ScanException: Failed to initialize Parser
ch.qos.logback.core.pattern.parser.ScanException: Failed to initialize Parser
at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:26)
at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:73)
at ch.qos.logback.core.pattern.parser.AbstractPatternLayoutBaseTest.testNullPattern(AbstractPatternLayoutBaseTest.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: java.lang.NullPointerException: null pattern string not allowed
at ch.qos.logback.core.pattern.parser.TokenStream.<init>(TokenStream.java:50)
at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:23)
... 30 more
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029 sec
Running ch.qos.logback.classic.MessageFormattingTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 sec
Running ch.qos.logback.classic.boolex.JaninoEventEvaluatorTest
INFO] Some message
INFO] Some message
timestamp > 10]: 10298 nanos
x.matches(message): 20201 nanos
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.572 sec
Running ch.qos.logback.classic.net.SMTPAppenderTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.257 sec
Running ch.qos.logback.classic.joran.EvaluatorJoranTest
LOGBACK: No context given for ch.qos.logback.core.joran.action.NestedSimplePropertyIA
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-WARN in ch.qos.logback.classic.joran.action.EvaluatorAction - Assuming default evaluator class [ch.qos.logback.classic.boolex.JaninoEventEvaluator]
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Adding evaluator named [IGNORE_EVAL] to the object stack
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Starting evaluator named [IGNORE_EVAL]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-WARN in ch.qos.logback.classic.joran.action.EvaluatorAction - Assuming default evaluator class [ch.qos.logback.classic.boolex.JaninoEventEvaluator]
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Adding evaluator named [IGNORE_EVAL] to the object stack
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Starting evaluator named [IGNORE_EVAL]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-WARN in ch.qos.logback.classic.joran.action.EvaluatorAction - Assuming default evaluator class [ch.qos.logback.classic.boolex.JaninoEventEvaluator]
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Adding evaluator named [IGNORE_EVAL] to the object stack
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Starting evaluator named [IGNORE_EVAL]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
2006-11-09 17:20:27,001 DEBUG - hello
java.lang.Exception: test
at ch.qos.logback.classic.joran.EvaluatorJoranTest.testIgnoreMarker(EvaluatorJoranTest.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
2006-11-09 17:20:27,004 DEBUG - hello ignore
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-WARN in ch.qos.logback.classic.joran.action.EvaluatorAction - Assuming default evaluator class [ch.qos.logback.classic.boolex.JaninoEventEvaluator]
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Adding evaluator named [IGNORE_EVAL] to the object stack
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Starting evaluator named [IGNORE_EVAL]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
|-ERROR in ch.qos.logback.classic.spi.LoggerContextAwareBase@5d6d2633 - Exception thrown for evaluator named [IGNORE_EVAL] ch.qos.logback.core.boolex.EvaluationException: Evaluator [IGNORE_EVAL] caused an exception
ch.qos.logback.core.boolex.EvaluationException: Evaluator [IGNORE_EVAL] caused an exception
at ch.qos.logback.core.boolex.JaninoEventEvaluatorBase.evaluate(JaninoEventEvaluatorBase.java:72)
at ch.qos.logback.classic.pattern.ThrowableInformationConverter.convert(ThrowableInformationConverter.java:107)
at ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:32)
at ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:115)
at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:163)
at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:167)
at ch.qos.logback.core.WriterAppender.subAppend(WriterAppender.java:267)
at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:114)
at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:71)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:286)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:270)
at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:422)
at ch.qos.logback.classic.Logger.debug(Logger.java:399)
at ch.qos.logback.classic.joran.EvaluatorJoranTest.testIgnoreMarker(EvaluatorJoranTest.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.janino.ScriptEvaluator.evaluate(Unknown Source)
at ch.qos.logback.core.boolex.JaninoEventEvaluatorBase.evaluate(JaninoEventEvaluatorBase.java:65)
... 40 more
Caused by: java.lang.NullPointerException
at SC.eval(ANONYMOUS.java:2)
... 46 more
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.059 sec
Running ch.qos.logback.classic.pattern.ConverterTest
java.lang.Exception: Bogus exception
java.lang.Exception: Bogus exception
Caller+0 at ch.qos.logback.classic.pattern.ConverterTest.testCallerData(ConverterTest.java:187)
Caller+1 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.142 sec
Running ch.qos.logback.classic.DynamicLoggerContextTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.753 sec
Running ch.qos.logback.classic.control.TestAction
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running ch.qos.logback.classic.db.DBAppenderTest
[Server@31884174]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@31884174]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@31884174]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@31884174]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@31884174]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@31884174]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
[Server@635aed57]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@635aed57]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@635aed57]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@635aed57]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@635aed57]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@635aed57]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
[Server@75be16f5]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@75be16f5]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@75be16f5]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@75be16f5]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@75be16f5]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@75be16f5]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
value: someValue
[Server@7f724a9d]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@7f724a9d]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@7f724a9d]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@7f724a9d]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@7f724a9d]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@7f724a9d]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.926 sec
Running ch.qos.logback.classic.util.InitializationTest
TEST 17:20:28.852 [main] DEBUG c.q.l.c.util.InitializationTest - Hello-didily-odily
TEST 17:20:28.853 [main] DEBUG c.q.l.c.util.InitializationTest - Hello-didily-odily
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running ch.qos.logback.classic.LoggerPerfTest
Running on pixie
Average log time for disabled statements: 7.0 nanos.
Running on pixie
Average log time for disabled statements: 20.0 nanos.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.588 sec
Running ch.qos.logback.classic.html.HTMLLayoutTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.419 sec
Running ch.qos.logback.classic.control.RandomUtilTest
Resulting average is 5.01783
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec
Running ch.qos.logback.classic.net.SocketAppenderTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.442 sec
Running ch.qos.logback.classic.net.SyslogAppenderTest
MockSyslogServer listening on port 14501
Waiting for message
Got message
MockSyslogServer listening on port 14502
Waiting for message
Got message
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.226 sec
Running ch.qos.logback.classic.control.ScenarioMakerTest
CreateLogger(ljggekfdysousqjomupjiohnoxq)
CreateLogger(bvifcmybxtrznamfkzlsiqmhofw)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.rzbtjobjewalmeqyxblexlwqrwpchucbptqmfec)
SetLevel(INFO, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.rzbtjobjewalmeqyxblexlwqrwpchucbptqmfec)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.sconxzboswtpubzgjindmbwskxewvkshzpkistnlniocijaesypjwclzswiy)
SetLevel(DEBUG, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.sconxzboswtpubzgjindmbwskxewvkshzpkistnlniocijaesypjwclzswiy)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.rzeafvjxmvberuvmbyjxzospogus)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.qxkpagyuzpvcltrpjvokzt)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.mhzsrnhrzjwcbjablolmlymhkwrelapoixghaacnxkidyoinstososm.jprxvqteaohafrmugfxbyvijkbyfbnos)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.njquybkyqphfcnulkqpwtbihgddbxqgmrxicelaonogjcxlitpryimdak.dgklnhbjmlrndpdnwsfjkrmhuyoxauvfhibjqtpt)
SetLevel(INFO, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.njquybkyqphfcnulkqpwtbihgddbxqgmrxicelaonogjcxlitpryimdak.dgklnhbjmlrndpdnwsfjkrmhuyoxauvfhibjqtpt)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.njquybkyqphfcnulkqpwtbihgddbxqgmrxicelaonogjcxlitpryimdak.bhstraisbrdcarvltibccjz)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.njquybkyqphfcnulkqpwtbihgddbxqgmrxicelaonogjcxlitpryimdak.rripvpurpstjpfzym)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.njquybkyqphfcnulkqpwtbihgddbxqgmrxicelaonogjcxlitpryimdak.ltckthuwgtraszksrfdcodspvbyyxgfolfltqhdfojmg)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.szgkwydrxisfhwtsdvraummfnhaytablthtypgqejfavo.xzbjclbwpoptlfiakyudsqtzgtozjlgbcbfszunisgexouuqlqsxs)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.szgkwydrxisfhwtsdvraummfnhaytablthtypgqejfavo.azcikomyelznxndbcxbvmkpwmscqt)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.szgkwydrxisfhwtsdvraummfnhaytablthtypgqejfavo.bjunncpxyawurawxkwjdwnclzhfxaaqrafpabrfjlse)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.szgkwydrxisfhwtsdvraummfnhaytablthtypgqejfavo.wew)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.szgkwydrxisfhwtsdvraummfnhaytablthtypgqejfavo.plpy)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.lyqiuiiovzrwujbuxzdnoidmhxtxqeepufkmyeaanwwsgt)
SetLevel(DEBUG, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.lyqiuiiovzrwujbuxzdnoidmhxtxqeepufkmyeaanwwsgt)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.dsncrzuhikbayfarjaxwppvccgildpgtepnlqeftnhrinzbkijoetxpirjiaiqysas)
SetLevel(DEBUG, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.dsncrzuhikbayfarjaxwppvccgildpgtepnlqeftnhrinzbkijoetxpirjiaiqysas)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.ofxljzobrludcnejulwxducplonrkqwqhlrfanxafyg)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.txoasruuwnggozsdqs.murkmlkvgkerioavjfrppltnddtpqvczne)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ouhiltsaabrdybgsfkaaiafscevlllnzt.gnarpakghuhtcfmkhfbauzcbbtlq)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ouhiltsaabrdybgsfkaaiafscevlllnzt.godcftqbrwkjdfrrioyzwmrmwpspvpztqbqqoulruyjkjbtndeenwonvcjnuczjegnxfjcsqehkn)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ouhiltsaabrdybgsfkaaiafscevlllnzt.iwajobbvpsuuqvgjsk)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ouhiltsaabrdybgsfkaaiafscevlllnzt.oyxsymrviydbmnelebbkvahofgbzxxrlpdkcxsypldjzosdbodjpuoljiohjdcw)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ompilgezwcluzuffjdyxbaltrgfsfhxnxnwwkveuibkqiphq.ukdwyjklntgkvcdhzusmrj)
SetLevel(ERROR, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.ompilgezwcluzuffjdyxbaltrgfsfhxnxnwwkveuibkqiphq.ukdwyjklntgkvcdhzusmrj)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.g)
SetLevel(DEBUG, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.g)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.wexcnbkawjvfoeizazdxhlaqjuxb)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.xchowexpifwleubiymndxaxlxftetgp)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.bekqkxuuctmptezricsktevakkgpizcuitftrohmhpluhbzgaarqxljo)
CreateLogger(ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.mxysyqbjuggrklmsjgvoajkyzjuurvtpztlajniok)
SetLevel(DEBUG, ogkozkyaunwfk.xwjjgisoszlqenwjinmb.uhhdwizvnotxhlyzjns.t.mxysyqbjuggrklmsjgvoajkyzjuurvtpztlajniok)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.038 sec
Running ch.qos.logback.classic.joran.BasicJoranTest
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.appender.ListAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LIST]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [LIST] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [LIST to Logger[root]
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.appender.ListAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LIST]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [LIST] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - ch.qos.logback.classic.joran level set to INFO
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [LIST to Logger[root]
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
LOGBACK: No context given for ch.qos.logback.core.joran.action.NestedSimplePropertyIA
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-WARN in ch.qos.logback.classic.joran.action.EvaluatorAction - Assuming default evaluator class [ch.qos.logback.classic.boolex.JaninoEventEvaluator]
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Adding evaluator named [helloEval] to the object stack
|-INFO in ch.qos.logback.core.joran.action.MatcherAction - matcher named as [m]
|-INFO in ch.qos.logback.core.joran.action.MatcherAction - Popping appender named [m] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.EvaluatorAction - Starting evaluator named [helloEval]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
2006-11-09 17:20:30,624 DEBUG - toto
Caller+0 at ch.qos.logback.classic.joran.BasicJoranTest.testEval(BasicJoranTest.java:81)
Caller+1 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caller+2 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Caller+3 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2006-11-09 17:20:30,625 DEBUG - hello world
LOGBACK: No context given for ch.qos.logback.core.joran.action.NestedSimplePropertyIA
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-INFO in ch.qos.logback.core.joran.action.NestedComponentIA - was deemed applicable for [configuration][turboFilter]
|-INFO in ch.qos.logback.core.joran.action.NestedComponentIA - Pushing component <turboFilter> on top of the object stack.
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
LOGBACK: No context given for ch.qos.logback.core.joran.action.NestedSimplePropertyIA
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring debug attribute.
|-INFO in ch.qos.logback.core.joran.action.NestedComponentIA - was deemed applicable for [configuration][turboFilter]
|-INFO in ch.qos.logback.core.joran.action.NestedComponentIA - Pushing component <turboFilter> on top of the object stack.
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE to Logger[root]
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 sec
Results :
Tests run: 105, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar]
[INFO] Building jar: /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/logback-classic-0.6-SNAPSHOT.jar
[INFO] [jar:jar {execution: bundle-test-jar}]
[INFO] [jar:test-jar {execution: bundle-test-jar}]
[INFO] Building jar: /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/logback-classic-0.6-SNAPSHOT-tests.jar
[INFO] [install:install]
[INFO] Installing /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/logback-classic-0.6-SNAPSHOT.jar to /root/.m2/repository/ch/qos/logback/logback-classic/0.6-SNAPSHOT/logback-classic-0.6-SNAPSHOT.jar
[INFO] Installing /opt/continuum-1.0.3/apps/continuum/working-directory/46/target/logback-classic-0.6-SNAPSHOT-tests.jar to /root/.m2/repository/ch/qos/logback/logback-classic/0.6-SNAPSHOT/logback-classic-0.6-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Thu Nov 09 17:20:31 CET 2006
[INFO] Final Memory: 12M/147M
[INFO] ------------------------------------------------------------------------
****************************************************************************
1
0

svn commit: r889 - in logback/trunk: logback-examples/src/main/java/chapter4/db logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 09 Nov '06
by noreply.seb@qos.ch 09 Nov '06
09 Nov '06
Author: seb
Date: Thu Nov 9 17:19:58 2006
New Revision: 889
Added:
logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml
logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml
Modified:
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
first draft of pooling test results
Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml Thu Nov 9 17:19:58 2006
@@ -0,0 +1,28 @@
+<configuration>
+
+ <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+ <connectionSource
+ class="ch.qos.logback.core.db.DataSourceConnectionSource">
+ <dataSource
+ class="com.mchange.v2.c3p0.ComboPooledDataSource">
+ <driverClass>com.mysql.jdbc.Driver</driverClass>
+ <jdbcUrl>jdbc:mysql://localhost:3306/logbackdb</jdbcUrl>
+ <user>logback</user>
+ <password>logback</password>
+ </dataSource>
+ </connectionSource>
+ </appender>
+
+ <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+ <logger name="ch.qos.logback.core.joran">
+ <level value="INFO" />
+ </logger>
+ <logger name="ch.qos.logback.classic.joran">
+ <level value="INFO" />
+ </logger>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="DB" />
+ </root>
+</configuration>
\ No newline at end of file
Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml Thu Nov 9 17:19:58 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<configuration>
+
+ <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+ <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+ <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
+ <serverName>${serverName}</serverName>
+ <port>${port$</port>
+ <databaseName>${dbName}</databaseName>
+ <user>${user}</user>
+ <password>${pass}</password>
+ </dataSource>
+ </connectionSource>
+ </appender>
+
+ <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+ <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+ <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="DB" />
+ </root>
+
+</configuration>
\ No newline at end of file
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml Thu Nov 9 17:19:58 2006
@@ -2096,7 +2096,100 @@
<em>jndi.properties</em>
file as described by your JNDI provider's documentation.
</p>
+
+ <h4>Connection pooling</h4>
+
+ <p>
+ Logging events can be created at a rather fast pace. To keep up
+ with the flow of events that must be inserted into a database,
+ it is recommanded to use connection pooling with
+ <code>DBAppender</code>.
+ </p>
+
+ <p>
+ Experiment shows that using connection pooling with <code>DBAppender</code>
+ gives a big boost to the process' performance. With the following
+ configuration file, logging events are sent to a MySQL database,
+ without any pooling.
+ </p>
+<em>Example 4.8: <code>DBAppender</code> configuration without pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource.xml)</em>
+<div class="source"><pre><configuration>
+
+ <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+ <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+ <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
+ <serverName>${serverName}</serverName>
+ <port>${port$</port>
+ <databaseName>${dbName}</databaseName>
+ <user>${user}</user>
+ <password>${pass}</password>
+ </dataSource>
+ </connectionSource>
+ </appender>
+
+ <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+ <logger name="ch.qos.logback.core.joran">
+ <level value="INFO" />
+ </logger>
+ <logger name="ch.qos.logback.classic.joran">
+ <level value="INFO" />
+ </logger>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="DB" />
+ </root>
+</configuration</pre></div>
+
+ <p>
+ With this configuration file, sending 500 logging events to
+ a MySQL database takes a whopping 22 seconds. This figure is absolutely
+ unacceptable when dealing with large applications.
+ </p>
+
+ <p>
+ A dedicated external library is necessary to use connection pooling
+ with <code>DBAppender</code>. The next example uses
+ <a href="http://sourceforge.net/projects/c3p0">c3p0</a>. To be able
+ to use c3p0, one must download it and place <em>c3p0-VERSION.jar</em>
+ in the classpath.
+ </p>
+
+<em>Example 4.8: <code>DBAppender</code> configuration with pooling (logback-examples/src/main/java/chapter4/db/append-toMySQL-with-datasource-and-pooling.xml)</em>
+<div class="source"><pre><configuration>
+
+ <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+ <connectionSource
+ class="ch.qos.logback.core.db.DataSourceConnectionSource">
+ <b><dataSource
+ class="com.mchange.v2.c3p0.ComboPooledDataSource">
+ <driverClass>com.mysql.jdbc.Driver</driverClass>
+ <jdbcUrl>jdbc:mysql://${serverName}:${port}/${dbName}</jdbcUrl>
+ <user>${user}</user>
+ <password>${password}</password>
+ </dataSource></b>
+ </connectionSource>
+ </appender>
+ <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+ <logger name="ch.qos.logback.core.joran">
+ <level value="INFO" />
+ </logger>
+ <logger name="ch.qos.logback.classic.joran">
+ <level value="INFO" />
+ </logger>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="DB" />
+ </root>
+</configuration></pre></div>
+
+ <p>
+ With this new configuration, sending 500 logging requests to
+ the same MySQL database as previously used takes no more than 5 seconds.
+ The gain is a <em>4.4</em> factor.
+ </p>
<h3>SyslogAppender</h3>
1
0

svn commit: r888 - in logback/trunk: logback-classic/src/test/java/ch/qos/logback/classic/net logback-examples/src/main/java/chapter4/conf logback-examples/src/main/java/chapter4/db logback-site/src/site/xdocTemplates/manual
by noreply.seb@qos.ch 09 Nov '06
by noreply.seb@qos.ch 09 Nov '06
09 Nov '06
Author: seb
Date: Thu Nov 9 09:50:06 2006
New Revision: 888
Added:
logback/trunk/logback-examples/src/main/java/chapter4/db/append-and-share-with-jndi.xml
- copied unchanged from r883, /logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
Removed:
logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
Modified:
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java
logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
on going work on chapter 4
- SyslogAppender config (yet to be tested in real life)
- Modified SyslogAppenderTest, progress need to be done here, on testWithExceptions
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/net/SyslogAppenderTest.java Thu Nov 9 09:50:06 2006
@@ -30,7 +30,7 @@
}
public void testBasic() throws InterruptedException {
- int port = MockSyslogServer.PORT+1;
+ int port = MockSyslogServer.PORT + 1;
MockSyslogServer mockServer = new MockSyslogServer(1, port);
mockServer.start();
@@ -44,35 +44,37 @@
sa.setSyslogHost("localhost");
sa.setFacility("MAIL");
sa.setPort(port);
+ sa.setSuffixPattern("[%thread] %logger %msg %exception");
sa.start();
assertTrue(sa.isStarted());
-
+
String loggerName = this.getClass().getName();
Logger logger = lc.getLogger(loggerName);
logger.addAppender(sa);
String logMsg = "hello";
logger.debug(logMsg);
StatusPrinter.print(lc.getStatusManager());
-
+
// wait max 2 seconds for mock server to finish. However, it should
// much sooner than that.
mockServer.join(8000);
assertTrue(mockServer.finished);
assertEquals(1, mockServer.msgList.size());
String msg = mockServer.msgList.get(0);
-
- String expected = "<"+(SyslogConstants.LOG_MAIL+SyslogConstants.DEBUG_SEVERITY)+">";
+
+ String expected = "<"
+ + (SyslogConstants.LOG_MAIL + SyslogConstants.DEBUG_SEVERITY) + ">";
assertTrue(msg.startsWith(expected));
String first = "<\\d{2}>\\w{3} \\d{2} \\d{2}(:\\d{2}){2} \\w* ";
String threadName = Thread.currentThread().getName();
-
- assertTrue(msg.matches(first +"\\["+threadName+"\\] "+ loggerName +" " +logMsg));
-
- }
-
- public void testExceptoin() throws InterruptedException {
- int port = MockSyslogServer.PORT+2;
+ assertTrue(msg.matches(first + "\\[" + threadName + "\\] " + loggerName
+ + " " + logMsg + " "));
+
+ }
+
+ public void testException() throws InterruptedException {
+ int port = MockSyslogServer.PORT + 2;
MockSyslogServer mockServer = new MockSyslogServer(1, port);
mockServer.start();
// give MockSyslogServer head start
@@ -85,31 +87,36 @@
sa.setSyslogHost("localhost");
sa.setFacility("MAIL");
sa.setPort(port);
+ sa.setSuffixPattern("[%thread] %logger %msg %exception");
sa.start();
assertTrue(sa.isStarted());
-
+
String loggerName = this.getClass().getName();
Logger logger = lc.getLogger(loggerName);
logger.addAppender(sa);
String logMsg = "hello";
- logger.debug(logMsg, new Exception("just testing"));
+ String exMsg = "just testing";
+ Exception ex = new Exception(exMsg);
+ logger.debug(logMsg, ex);
StatusPrinter.print(lc.getStatusManager());
-
+
// wait max 2 seconds for mock server to finish. However, it should
// much sooner than that.
mockServer.join(8000);
assertTrue(mockServer.finished);
assertEquals(1, mockServer.msgList.size());
String msg = mockServer.msgList.get(0);
-
- String expected = "<"+(SyslogConstants.LOG_MAIL+SyslogConstants.DEBUG_SEVERITY)+">";
+
+ String expected = "<"
+ + (SyslogConstants.LOG_MAIL + SyslogConstants.DEBUG_SEVERITY) + ">";
assertTrue(msg.startsWith(expected));
- //String first = "<\\d{2}>\\w{3} \\d{2} \\d{2}(:\\d{2}){2} \\w* ";
- //String threadName = Thread.currentThread().getName();
- System.out.println(msg);
- //assertTrue(msg.matches(first +"\\["+threadName+"\\] "+ loggerName +" " +logMsg));
-
- //fail("check exceptions");
+// String first = "<\\d{2}>\\w{3} \\d{2} \\d{2}(:\\d{2}){2} \\w* ";
+// String threadName = Thread.currentThread().getName();
+// String expectedResult = first + "\\[" + threadName + "\\] " + loggerName
+// + " " + logMsg + " " + ex.getClass().getCanonicalName() + ": " + exMsg + "\n";
+// assertTrue(msg.matches(expectedResult));
+
+ // fail("check exceptions");
}
}
Modified: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml (original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-syslog.xml Thu Nov 9 09:50:06 2006
@@ -1,10 +1,10 @@
<configuration>
- <appender name="STDOUT"
+ <appender name="SYSLOG"
class="ch.qos.logback.classic.net.SyslogAppender">
<SyslogHost>pixie</SyslogHost>
<Facility>AUTH</Facility>
- <SuffixPattern>%-4relative [%thread] %-5level - %msg %n</SuffixPattern>
+ <SuffixPattern>%-4relative [%thread] %-5level - %msg</SuffixPattern>
</appender>
<root>
Modified: logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml Thu Nov 9 09:50:06 2006
@@ -2035,6 +2035,33 @@
single configuration file and shared by logback and other frameworks.
</p>
+
+ <p>
+ The connection created by <code>DataSourceConnectionSource</code> can be placed in a JNDI
+ context by using <code>BindDataSourceToJNDIAction</code>. In that case, one has to specify
+ the use of this class by adding a new rule to Joran, logback's configuration framework. Here
+ is an excerpt of such a configuration file.
+ </p>
+
+<div class="source"><pre><configuration>
+ ..
+ <b><newRule pattern="configuration/bindDataSourceToJNDI"
+ actionClass="ch.qos.logback.core.db.BindDataSourceToJNDIAction"/>
+
+ <bindDataSourceToJNDI /></b>
+ ..
+</configuration></pre></div>
+
+ <p>
+ The <em>newRule</em> element teaches Joran to use specified action class with the given pattern.
+ Then, we simply declare the given element. The action class will be called and our connection
+ source will be bound to a JNDI context.
+ </p>
+ <p>
+ This is a very powerfull possibility of Joran. If you'd like to read more about Joran, please
+ visit our <a href="../joran.html">introduction to Joran</a>.
+ </p>
+
<p>
The third implementation of <code>ConnectionSource</code> that is shipped with
logback is the <code>JNDIConnectionSource</code>.
@@ -2054,13 +2081,11 @@
application server provides.
</p>
-<div class="source"><pre>
-<connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource">
+<div class="source"><pre><connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource">
<param name="jndiLocation" value="jdbc/MySQLDS" />
<param name="username" value="myUser" />
<param name="password" value="myPassword" />
-</connectionSource>
- </pre></div>
+</connectionSource></pre></div>
<p>
Note that this class will obtain an
@@ -2073,12 +2098,6 @@
</p>
- <p>
- <b>MORE INFO TO ADD HERE JNDI + BindAction + DataSourceCS? Or directly
- with JNDICS??</b>
- </p>
-
-
<h3>SyslogAppender</h3>
<p>
@@ -2176,13 +2195,36 @@
</p>
<p>
- Since the format of a syslog request follows rather strict rules,
+ Since the format of a syslog request follows rather strict rules, there is no layout
+ to be used with <code>SyslogAppender</code>. However, the using the
+ <span class="option">SuffixPattern</span> option lets the user display whatever
+ information she wishes.
</p>
+ <p>
+ Here is a sample configuration using a <code>SyslogAppender</code>.
+ </p>
-
-
-
+<div class="source"><pre><configuration>
+
+ <appender name="SYSLOG"
+ class="ch.qos.logback.classic.net.SyslogAppender">
+ <SyslogHost>remote_home</SyslogHost>
+ <Facility>AUTH</Facility>
+ <SuffixPattern>%-4relative [%thread] %-5level - %msg</SuffixPattern>
+ </appender>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration></pre></div>
+
+ <p>
+ When testing this configuration, one should verify that the remote syslog daemon
+ accepts TCP requests from an external source. Experience shows that syslog daemons
+ usually deny such requests by default.
+ </p>
<h2>Logback Access</h2>
1
0