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
November 2006
- 5 participants
- 262 discussions

svn commit: r921 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/util test/java/ch/qos/logback/core/util
by noreply.ceki@qos.ch 15 Nov '06
by noreply.ceki@qos.ch 15 Nov '06
15 Nov '06
Author: ceki
Date: Wed Nov 15 15:37:40 2006
New Revision: 921
Modified:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PackageTest.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
Log:
Finalizing work on Duration and co.
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java Wed Nov 15 15:37:40 2006
@@ -12,12 +12,25 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+/**
+ * Duration instances represent a lapse of time. Internally, the duration is stored
+ * in milliseconds.
+ * <p>
+ *
+ * The {@link #valueOf} method can convert strings such as "3.5 minutes", "5 hours", into
+ * Duration instances. The recognized units of time are the "millisecond", "second", "minute"
+ * "hour" and "day". The unit name may be followed by an "s". Thus, "2 day" and "2 days" are
+ * equivalent. In the absence of a time unit specification, milliseconds are assumed.
+ *
+ *
+ * @author Ceki Gulcu
+ */
public class Duration {
private final static String DOUBLE_PART = "([0-9]*(.[0-9]+)?)";
private final static int DOUBLE_GROUP = 1;
- private final static String UNIT_PART = "(millisecond|second|minute|hour|day)s?";
+ private final static String UNIT_PART = "(|millisecond|second|minute|hour|day)s?";
private final static int UNIT_GROUP = 3;
private static final Pattern DURATION_PATTERN = Pattern.compile(DOUBLE_PART
@@ -30,7 +43,7 @@
final long millis;
- Duration(long millis) {
+ public Duration(long millis) {
this.millis = millis;
}
@@ -53,9 +66,12 @@
public static Duration buildByDays(double value) {
return new Duration((long) (DAYS_COEFFICIENT*value));
}
+
+ public static Duration buildUnbounded() {
+ return new Duration(Long.MAX_VALUE);
+ }
-
- public long getMilliSeconds() {
+ public long getMilliseconds() {
return millis;
}
@@ -67,7 +83,7 @@
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
- if (unitStr.equalsIgnoreCase("millisecond")) {
+ if (unitStr.equalsIgnoreCase("millisecond") || unitStr.length() == 0) {
return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")) {
return buildBySeconds(doubleValue);
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java Wed Nov 15 15:37:40 2006
@@ -147,11 +147,12 @@
}
Class[] paramTypes = setter.getParameterTypes();
-
+
+
if (paramTypes.length != 1) {
throw new PropertySetterException("#params for setter != 1");
}
-
+
Object arg;
try {
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java Wed Nov 15 15:37:40 2006
@@ -31,48 +31,53 @@
public void test() {
{
+ Duration d = Duration.valueOf("12");
+ assertEquals(12, d.getMilliseconds());
+ }
+
+ {
Duration d = Duration.valueOf("8 milliseconds");
- assertEquals(8, d.getMilliSeconds());
+ assertEquals(8, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("10.7 millisecond");
- assertEquals(10, d.getMilliSeconds());
+ assertEquals(10, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("10 seconds");
- assertEquals(10 * 1000, d.getMilliSeconds());
+ assertEquals(10 * 1000, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("10.7 seconds");
- assertEquals(10700, d.getMilliSeconds());
+ assertEquals(10700, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("1 minute");
- assertEquals(1000*60, d.getMilliSeconds());
+ assertEquals(1000*60, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("2.2 minutes");
- assertEquals(2200*60, d.getMilliSeconds());
+ assertEquals(2200*60, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("1 hour");
- assertEquals(1000*HOURS_CO, d.getMilliSeconds());
+ assertEquals(1000*HOURS_CO, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("4.2 hours");
- assertEquals(4200*HOURS_CO, d.getMilliSeconds());
+ assertEquals(4200*HOURS_CO, d.getMilliseconds());
}
{
Duration d = Duration.valueOf("5 days");
- assertEquals(5000*DAYS_CO, d.getMilliSeconds());
+ assertEquals(5000*DAYS_CO, d.getMilliseconds());
}
}
}
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PackageTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PackageTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PackageTest.java Wed Nov 15 15:37:40 2006
@@ -10,6 +10,8 @@
public static Test suite() {
TestSuite suite = new TestSuite();
+ suite.addTestSuite(DurationTest.class);
+ suite.addTestSuite(PackageTest.class);
suite.addTestSuite(PropertySetterTest.class);
return suite;
}
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java Wed Nov 15 15:37:40 2006
@@ -113,7 +113,7 @@
House house = new House();
PropertySetter setter = new PropertySetter(house);
setter.setProperty("duration", "1.4 seconds");
- assertEquals(1400, house.getDuration().getMilliSeconds());
+ assertEquals(1400, house.getDuration().getMilliseconds());
}
public void testFileSize() {
1
0

15 Nov '06
Author: seb
Date: Wed Nov 15 12:00:54 2006
New Revision: 920
Modified:
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/PatternLayout.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java
logback/trunk/logback-site/src/site/xdocTemplates/manual/appenders.xml
Log:
updated doc, and linked all classes to the appropriate documentation section
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/PatternLayout.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/PatternLayout.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/PatternLayout.java Wed Nov 15 12:00:54 2006
@@ -43,7 +43,6 @@
* For more informations about this layout, please refer to the online manual at
* http://logback.qos.ch/manual/layouts.html#ClassicPatternLayout
*
- *
*/
public class PatternLayout extends PatternLayoutBase implements ClassicLayout {
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java Wed Nov 15 12:00:54 2006
@@ -20,82 +20,13 @@
import ch.qos.logback.classic.spi.CallerData;
import ch.qos.logback.classic.spi.LoggingEvent;
import ch.qos.logback.core.db.DBAppenderBase;
-import ch.qos.logback.core.db.dialect.SQLDialect;
/**
* The DBAppender inserts loggin events into three database tables in a format
- * independent of the Java programming language. The three tables that
- * DBAppender inserts to must exists before DBAppender can be used. These tables
- * may be created with the help of SQL scripts found in the
- * <em>src/main/java/ch/qos/logback/classic/db/dialect</em> directory. There
- * is a specific script for each of the most popular database systems. If the
- * script for your particular type of database system is missing, it should be
- * quite easy to write one, taking example on the already existing scripts. If
- * you send them to us, we will gladly include missing scripts in future
- * releases.
+ * independent of the Java programming language.
*
- * <p>
- * If the JDBC driver you are using supports the
- * {@link java.sql.Statement#getGeneratedKeys}method introduced in JDBC 3.0
- * specification, then you are all set. Otherwise, there must be an
- * {@link SQLDialect}appropriate for your database system. Currently, we have
- * dialects for PostgreSQL, MySQL, Oracle and MsSQL. As mentioed previously, an
- * SQLDialect is required only if the JDBC driver for your database system does
- * not support the {@link java.sql.Statement#getGeneratedKeys getGeneratedKeys}
- * method.
- * </p>
- *
- * <table border="1" cellpadding="4">
- * <tr>
- * <th>RDBMS</th>
- * <th>supports <br/><code>getGeneratedKeys()</code> method</th>
- * <th>specific <br/>SQLDialect support</th>
- * <tr>
- * <tr>
- * <td>PostgreSQL</td>
- * <td align="center">NO</td>
- * <td>present and used</td>
- * <tr>
- * <tr>
- * <td>MySQL</td>
- * <td align="center">YES</td>
- * <td>present, but not actually needed or used</td>
- * <tr>
- * <tr>
- * <td>Oracle</td>
- * <td align="center">YES</td>
- * <td>present, but not actually needed or used</td>
- * <tr>
- * <tr>
- * <td>DB2</td>
- * <td align="center">YES</td>
- * <td>not present, and not needed or used</td>
- * <tr>
- * <tr>
- * <td>MsSQL</td>
- * <td align="center">YES</td>
- * <td>not present, and not needed or used</td>
- * <tr>
- * <tr>
- * <td>HSQL</td>
- * <td align="center">NO</td>
- * <td>present and used</td>
- * <tr>
- *
- * </table>
- * <p>
- * <b>Performance: </b> Experiments show that writing a single event into the
- * database takes approximately 50 milliseconds, on a "standard" PC. If pooled
- * connections are used, this figure drops to under 10 milliseconds. Note that
- * most JDBC drivers already ship with connection pooling support.
- * </p>
- *
- *
- *
- * <p>
- * <b>Configuration </b> DBAppender can be configured programmatically, or using
- * {@link ch.qos.logback.classic.joran.JoranConfigurator JoranConfigurator}.
- * Example scripts can be found in the <em>tests/input/db</em> directory.
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#DBAppender
*
* @author Ceki Gülcü
* @author Ray DeCampo
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java Wed Nov 15 12:00:54 2006
@@ -22,12 +22,8 @@
* Send an e-mail when a specific logging event occurs, typically on errors or
* fatal errors.
*
- * <p>
- * The number of logging events delivered in this e-mail depend on the value of
- * <b>BufferSize</b> option. The <code>SMTPAppender</code> keeps only the
- * last <code>BufferSize</code> logging events in its cyclic buffer. This
- * keeps memory requirements at a reasonable level while still delivering useful
- * application context.
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#SMTPAppender
*
* @author Ceki Gülcü
* @author Sébastien Pennec
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java Wed Nov 15 12:00:54 2006
@@ -24,73 +24,9 @@
* Sends {@link LoggingEvent} objects to a remote a log server, usually a
* {@link SocketNode}.
*
- * <p>
- * The SocketAppender has the following properties:
- *
- * <ul>
- *
- * <p>
- * <li>If sent to a {@link SocketNode}, remote logging is non-intrusive as far
- * as the log event is concerned. In other words, the event will be logged with
- * the same time stamp, {@link org.apache.log4j.NDC}, location info as if it
- * were logged locally by the client.
- *
- * <p>
- * <li>SocketAppenders do not use a layout. They ship a serialized
- * {@link LoggingEvent} object to the server side.
- *
- * <p>
- * <li>Remote logging uses the TCP protocol. Consequently, if the server is
- * reachable, then log events will eventually arrive at the server.
- *
- * <p>
- * <li>If the remote server is down, the logging requests are simply dropped.
- * However, if and when the server comes back up, then event transmission is
- * resumed transparently. This transparent reconneciton is performed by a
- * <em>connector</em> thread which periodically attempts to connect to the
- * server.
- *
- * <p>
- * <li>Logging events are automatically <em>buffered</em> by the native TCP
- * implementation. This means that if the link to server is slow but still
- * faster than the rate of (log) event production by the client, the client will
- * not be affected by the slow network connection. However, if the network
- * connection is slower then the rate of event production, then the client can
- * only progress at the network rate. In particular, if the network link to the
- * the server is down, the client will be blocked.
- *
- * <p>
- * On the other hand, if the network link is up, but the server is down, the
- * client will not be blocked when making log requests but the log events will
- * be lost due to server unavailability.
- *
- * <p>
- * <li>Even if a <code>SocketAppender</code> is no longer attached to any
- * category, it will not be garbage collected in the presence of a connector
- * thread. A connector thread exists only if the connection to the server is
- * down. To avoid this garbage collection problem, you should {@link #close} the
- * the <code>SocketAppender</code> explicitly. See also next item.
- *
- * <p>
- * Long lived applications which create/destroy many <code>SocketAppender</code>
- * instances should be aware of this garbage collection problem. Most other
- * applications can safely ignore it.
- *
- * <p>
- * <li>If the JVM hosting the <code>SocketAppender</code> exits before the
- * <code>SocketAppender</code> is closed either explicitly or subsequent to
- * garbage collection, then there might be untransmitted data in the pipe which
- * might be lost. This is a common problem on Windows based systems.
- *
- * <p>
- * To avoid lost data, it is usually sufficient to {@link #close} the
- * <code>SocketAppender</code> either explicitly or by calling the
- * {@link org.apache.log4j.LogManager#shutdown} method before exiting the
- * application.
- *
- *
- * </ul>
- *
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#SocketAppender
+ *
* @author Ceki Gülcü
* @author Sébastien Pennec
*
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java Wed Nov 15 12:00:54 2006
@@ -20,6 +20,11 @@
import ch.qos.logback.core.net.SyslogWriter;
/**
+ * This appender can be used to send messages to a remote
+ * syslog daemon.
+ * <p>
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#SyslogAppender
*
* @author Ceki Gülcü
*/
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java Wed Nov 15 12:00:54 2006
@@ -16,7 +16,14 @@
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.status.WarnStatus;
-
+/**
+ * This class is used to manage base functionnalities of all appenders.
+ *
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#AppenderBase
+ *
+ * @author Ceki Gülcü
+ */
abstract public class AppenderBase extends ContextAwareBase implements
Appender, FilterAttachable {
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/ConsoleAppender.java Wed Nov 15 12:00:54 2006
@@ -17,7 +17,10 @@
* ConsoleAppender appends log events to <code>System.out</code> or
* <code>System.err</code> using a layout specified by the user. The default
* target is <code>System.out</code>.
- *
+ *
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#ConsoleAppender
+ *
* @author Ceki Gülcü
*/
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/FileAppender.java Wed Nov 15 12:00:54 2006
@@ -19,6 +19,9 @@
/**
* FileAppender appends log events to a file.
*
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#FileAppender
+ *
* @author Ceki Gülcü
*/
public class FileAppender extends WriterAppender {
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/WriterAppender.java Wed Nov 15 12:00:54 2006
@@ -16,6 +16,15 @@
import ch.qos.logback.core.status.ErrorStatus;
+/**
+ * WriterAppender appends events to a hava.io.Writer.
+ * This class provides basic services that other appenders build upon.
+ *
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#WriterAppender
+ *
+ * @author Ceki Gülcü
+ */
public class WriterAppender extends AppenderBase {
/**
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java Wed Nov 15 12:00:54 2006
@@ -18,36 +18,10 @@
/**
* When rolling over, <code>FixedWindowRollingPolicy</code> renames files
- * according to a fixed window algorithm as described below.
+ * according to a fixed window algorithm.
*
- * <p>
- * The <b>File</b> property, which is required, represents the name
- * of the file where current logging output will be written. The
- * <b>FileNamePattern</b> option represents the file name pattern for the
- * archived (rolled over) log files. If present, the <b>FileNamePattern</b>
- * option must include an integer token, that is the string "%i" somewhere
- * within the pattern.
- *
- * <p>
- * Let <em>max</em> and <em>min</em> represent the values of respectively
- * the <b>MaxIndex</b> and <b>MinIndex</b> options. Let "foo.log" be the value
- * of the <b>ActiveFile</b> option and "foo.%i.log" the value of
- * <b>FileNamePattern</b>. Then, when rolling over, the file
- * <code>foo.<em>max</em>.log</code> will be deleted, the file
- * <code>foo.<em>max-1</em>.log</code> will be renamed as
- * <code>foo.<em>max</em>.log</code>, the file
- * <code>foo.<em>max-2</em>.log</code> renamed as
- * <code>foo.<em>max-1</em>.log</code>, and so on, the file
- * <code>foo.<em>min+1</em>.log</code> renamed as
- * <code>foo.<em>min+2</em>.log</code>. Lastly, the active file
- * <code>foo.log</code> will be renamed as <code>foo.<em>min</em>.log</code>
- * and a new active file name <code>foo.log</code> will be created.
- *
- * <p>
- * Given that this rollover algorithm requires as many file renaming operations
- * as the window size, large window sizes are discouraged. The current
- * implementation will automatically reduce the window size to 12 when larger
- * values are specified by the user.
+ * For more informations about this policy, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#FixedWindowRollingPolicy
*
* @author Ceki Gülcü
*/
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java Wed Nov 15 12:00:54 2006
@@ -19,41 +19,9 @@
* <code>RollingFileAppender</code> extends {@link FileAppender} to backup the log files
* depending on {@link RollingPolicy} and {@link TriggeringPolicy}.
* <p>
- * To be of any use, a <code>RollingFileAppender</code> instance must have both
- * a <code>RollingPolicy</code> and a <code>TriggeringPolicy</code> set up.
- * However, if its <code>RollingPolicy</code> also implements the
- * <code>TriggeringPolicy</code> interface, then only the former needs to be
- * set up. For example, {@link TimeBasedRollingPolicy} acts both as a
- * <code>RollingPolicy</code> and a <code>TriggeringPolicy</code>.
*
- * <p><code>RollingFileAppender</code> can be configured programattically or
- * using {@link ch.qos.logback.classic.joran.JoranConfigurator}. Here is a sample
- * configration file:
-
-<pre><?xml version="1.0" encoding="UTF-8" ?>
-
-<configuration debug="true">
-
- <appender name="ROLL" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <b><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <param name="FileNamePattern" value="/wombat/foo.%d{yyyy-MM}.gz"/>
- </rollingPolicy></b>
-
- <layout class="ch.qos.logback.classic.PatternLayout">
- <param name="Pattern" value="%c{1} - %m%n"/>
- </layout>
- </appender>
-
- <root">
- <appender-ref ref="ROLL"/>
- </root>
-
-</configuration>
-</pre>
-
- *<p>This configuration file specifies a monthly rollover schedule including
- * automatic compression of the archived files. See
- * {@link TimeBasedRollingPolicy} for more details.
+ * For more informations about this appender, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#RollingFileAppender
*
* @author Heinz Richter
* @author Ceki Gülcü
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java Wed Nov 15 12:00:54 2006
@@ -17,35 +17,9 @@
* currently written to. If it grows bigger than the specified size,
* the FileAppender using the SizeBasedTriggeringPolicy rolls the file
* and creates a new one.
- * <p>
- * Here is an example of a configuration using SizeBasedTriggeringPolicy.
- * <p>
- * <pre>
- * <configuration>
- * <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- * <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- * <param name="ActiveFileName" value="outputFile.log" />
- * <param name="FileNamePattern" value="logFile.%i.log" />
- * <param name="MinIndex" value="1" />
- * <param name="MaxIndex" value="3" />
- * </rollingPolicy>
- *
- * <b><triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- * <param name="MaxFileSize" value="5MB" />
- * </triggeringPolicy></b>
- *
- * <layout class="ch.qos.logback.classic.PatternLayout">
- * <param name="pattern" value="%-4relative [%thread] %-5level %class - %msg%n" />
- * </layout>
- * </appender>
- *
- * <root>
- * <level value="debug" />
- * <appender-ref ref="FILE" />
- * </root>
- * </configuration>
- * </pre>
*
+ * For more informations about this policy, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#SizeBasedTriggeringPolicy
*
* @author Ceki Gülcü
*
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java Wed Nov 15 12:00:54 2006
@@ -21,128 +21,12 @@
/**
* <code>TimeBasedRollingPolicy</code> is both easy to configure and quite
- * powerful.
+ * powerful. It allows the rollover to be made based on time conditions.
+ * It is possible to specify that the rollover must occur each day, or month, for example.
*
- * <p>In order to use <code>TimeBasedRollingPolicy</code>, the
- * <b>FileNamePattern</b> option must be set. It basically specifies the name of the
- * rolled log files. The value <code>FileNamePattern</code> should consist of
- * the name of the file, plus a suitably placed <code>%d</code> conversion
- * specifier. The <code>%d</code> conversion specifier may contain a date and
- * time pattern as specified by the {@link java.text.SimpleDateFormat} class. If
- * the date and time pattern is omitted, then the default pattern of
- * "yyyy-MM-dd" is assumed. The following examples should clarify the point.
- *
- * <p>
- * <table cellspacing="5px" border="1">
- * <tr>
- * <th><code>FileNamePattern</code> value</th>
- * <th>Roll-over schedule</th>
- * <th>Example</th>
- * </tr>
- * <tr>
- * <td nowrap="true"><code>/wombat/folder/foo.%d</code></td>
- * <td>Daily rollover (at midnight). Due to the omission of the optional
- * time and date pattern for the %d token specifier, the default pattern
- * of "yyyy-MM-dd" is assumed, which corresponds to daily rollover.
- * </td>
- * <td>During November 23rd, 2004, logging output will go to
- * the file <code>/wombat/foo.2004-11-23</code>. At midnight and for
- * the rest of the 24th, logging output will be directed to
- * <code>/wombat/foo.2004-11-24</code>.
- * </td>
- * </tr>
- * <tr>
- * <td nowrap="true"><code>/wombat/foo.%d{yyyy-MM}.log</code></td>
- * <td>Rollover at the beginning of each month.</td>
- * <td>During the month of October 2004, logging output will go to
- * <code>/wombat/foo.2004-10.log</code>. After midnight of October 31st
- * and for the rest of November, logging output will be directed to
- * <code>/wombat/foo.2004-11.log</code>.
- * </td>
- * </tr>
- * </table>
- * <h2>Automatic file compression</h2>
- * <code>TimeBasedRollingPolicy</code> supports automatic file compression.
- * This feature is enabled if the value of the <b>FileNamePattern</b> option
- * ends with <code>.gz</code> or <code>.zip</code>.
- * <p>
- * <table cellspacing="5px" border="1">
- * <tr>
- * <th><code>FileNamePattern</code> value</th>
- * <th>Rollover schedule</th>
- * <th>Example</th>
- * </tr>
- * <tr>
- * <td nowrap="true"><code>/wombat/foo.%d.gz</code></td>
- * <td>Daily rollover (at midnight) with automatic GZIP compression of the
- * arcived files.</td>
- * <td>During November 23rd, 2004, logging output will go to
- * the file <code>/wombat/foo.2004-11-23</code>. However, at midnight that
- * file will be compressed to become <code>/wombat/foo.2004-11-23.gz</code>.
- * For the 24th of November, logging output will be directed to
- * <code>/wombat/folder/foo.2004-11-24</code> until its rolled over at the
- * beginning of the next day.
- * </td>
- * </tr>
- * </table>
+ * For more informations about this policy, please refer to the online manual at
+ * http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy
*
- * <h2>Decoupling the location of the active log file and the archived log files</h2>
- * <p>The <em>active file</em> is defined as the log file for the current period
- * whereas <em>archived files</em> are those files which have been rolled over
- * in previous periods.
- *
- * <p>By setting the <b>ActiveFileName</b> option you can decouple the location
- * of the active log file and the location of the archived log files.
- * <p>
- * <table cellspacing="5px" border="1">
- * <tr>
- * <th><code>FileNamePattern</code> value</th>
- * <th>ActiveFileName</th>
- * <th>Rollover schedule</th>
- * <th>Example</th>
- * </tr>
- * <tr>
- * <td nowrap="true"><code>/wombat/foo.log.%d</code></td>
- * <td nowrap="true"><code>/wombat/foo.log</code></td>
- * <td>Daily rollover.</td>
- *
- * <td>During November 23rd, 2004, logging output will go to
- * the file <code>/wombat/foo.log</code>. However, at midnight that file
- * will archived as <code>/wombat/foo.log.2004-11-23</code>. For the 24th
- * of November, logging output will be directed to
- * <code>/wombat/folder/foo.log</code> until its archived as
- * <code>/wombat/foo.log.2004-11-24</code> at the beginning of the next
- * day.
- * </td>
- * </tr>
- * </table>
- * <p>
- * <h2>Configuration example</h2>
- * <p>Here is a complete logback configuration xml file that uses TimeBasedTriggeringPolicy.
- * <p>
- * <pre>
- * <configuration>
- * <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- * <b><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- * <param name="FileNamePattern" value="foo_%d{yyyy-MM}.log" />
- * <param name="ActiveFileName" value="foo.log" />
- * </rollingPolicy></b>
- * <layout class="ch.qos.logback.classic.PatternLayout">
- * <param name="Pattern" value="%-4relative [%thread] %-5level %class - %msg%n" />
- * </layout>
- * </appender>
- *
- * <root>
- * <level value="debug" />
- * <appender-ref ref="FILE" />
- * </root>
- * </configuration>
- * </pre>
- * <p>
- * This configuration will produce output to a file called <code>foo.log</code>. For example, at the end of the month
- * of September 2006, the file will be renamed to <code>foo_2006-09.log</code> and a new <code>foo.log</code> file
- * will be created and used for actual logging.
- *
* @author Ceki Gülcü
*/
public class TimeBasedRollingPolicy extends RollingPolicyBase implements TriggeringPolicy {
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 Wed Nov 15 12:00:54 2006
@@ -197,7 +197,7 @@
event to the appropriate device.
</p>
- <p>DO WE ADD A UML DIAGRAM?? YES!!</p>
+ <!-- ADD UML DIAGRAM -->
<p>In appenders, the term option or property is reserved for named attributes
that are dynamically inferred using JavaBeans introspection. </p>
@@ -214,7 +214,8 @@
<h3>WriterAppender</h3>
<p>
- <a href="../xref/ch/qos/logback/core/WriterAppender.html"><code>WriterAppender</code></a> appends events to a <code>java.io.Writer</code>.
+ <a href="../xref/ch/qos/logback/core/WriterAppender.html"><code>WriterAppender</code></a>
+ appends events to a <code>java.io.Writer</code>.
This class provides basic services that other appenders build upon.
Users do not usually instantiate <code>WriterAppender</code> objects directly.
Since <code>java.io.Writer</code> type cannot be mapped to a string, there is no
@@ -329,9 +330,9 @@
namely <code>ConsoleAppender</code>, <code>FileAppender</code> which in turn is
the super class of <code>RollingFileAppender</code>.
</p>
- <p><b>include UML??</b>
- Figure 4 2 illustrates the class diagram for WriterAppender and its subclasses
- </p>
+
+ <!-- ADD UML DIAGRAM -->
+
<a name="ConsoleAppender" />
<h3>ConsoleAppender</h3>
@@ -1730,7 +1731,7 @@
-
+ <a name="DBAppender"/>
<h3>DBAppender</h3>
<p>
@@ -1819,9 +1820,9 @@
<p>
Experiments show that writing a single event
- into the database takes approximately 50 milliseconds, on a
+ into the database takes approximately 10 milliseconds, on a
"standard" PC. If pooled connections are used, this figure
- drops to under 10 milliseconds. Note that most JDBC drivers
+ drops to around 1 milliseconds. Note that most JDBC drivers
already ship with connection pooling support.
</p>
@@ -2048,6 +2049,9 @@
<code>javax.sql.DataSource</code>, e.g. within a J2EE application
server, see <code>JNDIConnectionSource</code>).
</p>
+<!--
+
+ HAS TO BE TESTED
<p>
If you do not have another connection pooling mechanism built
@@ -2071,7 +2075,8 @@
<a href="http://jakarta.apache.org/commons/dbcp/index.html"> commons-dbcp </a>
documentation for details.
</p>
-
+ -->
+
<p>
Connecting to a database using a <code>DataSource</code> is rather similar.
The configuration now uses
@@ -2255,6 +2260,7 @@
The gain is a <em>4.4</em> factor.
</p>
+ <a name="SyslogAppender" />
<h3>SyslogAppender</h3>
<p>
@@ -2385,10 +2391,25 @@
</p>
+ <a name="Access" />
<h2>Logback Access</h2>
+ <p>
+ Most of the appenders found in logback classic can be used within
+ logback access. They function mostly in the same way as their logback
+ classic counterpart. Precise documentation about these appenders will
+ follow.
+ </p>
+
+<!--
+ <h3>SocketAppender</h3>
+
<h3>SMTPAppender</h3>
-
+
+ <h3>DBAppender</h3>
+
+ <h3>SyslogAppender</h3>
+ -->
1
0

svn commit: r919 - logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util
by noreply.ceki@qos.ch 15 Nov '06
by noreply.ceki@qos.ch 15 Nov '06
15 Nov '06
Author: ceki
Date: Wed Nov 15 10:30:41 2006
New Revision: 919
Modified:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
Log:
factory methods should be static
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java Wed Nov 15 10:30:41 2006
@@ -34,23 +34,23 @@
this.millis = millis;
}
- Duration buildByMilliseconds(double value) {
+ public static Duration buildByMilliseconds(double value) {
return new Duration((long) (value));
}
- Duration buildBySeconds(double value) {
+ public static Duration buildBySeconds(double value) {
return new Duration((long) (SECONDS_COEFFICIENT*value));
}
- Duration buildByMinutes(double value) {
+ public static Duration buildByMinutes(double value) {
return new Duration((long) (MINUTES_COEFFICIENT*value));
}
- Duration buildByHours(double value) {
+ public static Duration buildByHours(double value) {
return new Duration((long) (HOURS_COEFFICIENT*value));
}
- Duration buildByDays(double value) {
+ public static Duration buildByDays(double value) {
return new Duration((long) (DAYS_COEFFICIENT*value));
}
@@ -62,26 +62,24 @@
public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
- long coefficient;
if (matcher.matches()) {
String doubleStr = matcher.group(DOUBLE_GROUP);
String unitStr = matcher.group(UNIT_GROUP);
double doubleValue = Double.valueOf(doubleStr);
if (unitStr.equalsIgnoreCase("millisecond")) {
- coefficient = 1;
+ return buildByMilliseconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("second")) {
- coefficient = SECONDS_COEFFICIENT;
+ return buildBySeconds(doubleValue);
} else if (unitStr.equalsIgnoreCase("minute")) {
- coefficient = MINUTES_COEFFICIENT;
+ return buildByMinutes(doubleValue);
} else if (unitStr.equalsIgnoreCase("hour")) {
- coefficient = HOURS_COEFFICIENT;
+ return buildByHours(doubleValue);
} else if (unitStr.equalsIgnoreCase("day")) {
- coefficient = DAYS_COEFFICIENT;
+ return buildByDays(doubleValue);
} else {
throw new IllegalStateException("Unexpected" + unitStr);
}
- return new Duration((long) (doubleValue * coefficient));
} else {
throw new IllegalArgumentException("String value [" + durationStr
+ "] is not in the expected format.");
1
0

svn commit: r918 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/util test/java/ch/qos/logback/core/util
by noreply.ceki@qos.ch 15 Nov '06
by noreply.ceki@qos.ch 15 Nov '06
15 Nov '06
Author: ceki
Date: Wed Nov 15 09:53:36 2006
New Revision: 918
Modified:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
Log:
ongoing work on Duration and FileSize support
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java Wed Nov 15 09:53:36 2006
@@ -34,11 +34,32 @@
this.millis = millis;
}
- long getMilliSeconds() {
+ Duration buildByMilliseconds(double value) {
+ return new Duration((long) (value));
+ }
+
+ Duration buildBySeconds(double value) {
+ return new Duration((long) (SECONDS_COEFFICIENT*value));
+ }
+
+ Duration buildByMinutes(double value) {
+ return new Duration((long) (MINUTES_COEFFICIENT*value));
+ }
+
+ Duration buildByHours(double value) {
+ return new Duration((long) (HOURS_COEFFICIENT*value));
+ }
+
+ Duration buildByDays(double value) {
+ return new Duration((long) (DAYS_COEFFICIENT*value));
+ }
+
+
+ public long getMilliSeconds() {
return millis;
}
- static Duration valueOf(String durationStr) {
+ public static Duration valueOf(String durationStr) {
Matcher matcher = DURATION_PATTERN.matcher(durationStr);
long coefficient;
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java Wed Nov 15 09:53:36 2006
@@ -34,11 +34,11 @@
this.size = size;
}
- long getSize() {
+ public long getSize() {
return size;
}
- static FileSize valueOf(String fileSizeStr) {
+ static public FileSize valueOf(String fileSizeStr) {
Matcher matcher = FILE_SIZE_PATTERN.matcher(fileSizeStr);
long coefficient;
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java Wed Nov 15 09:53:36 2006
@@ -113,7 +113,7 @@
name = Introspector.decapitalize(name);
PropertyDescriptor prop = getPropertyDescriptor(name);
-
+
if (prop == null) {
addWarn("No such property [" + name + "] in " + objClass.getName() + ".");
} else {
@@ -231,9 +231,11 @@
return X_AS_PROPERTY;
} else if ("java.lang".equals(p.getName())) {
return X_AS_PROPERTY;
- } else if(Duration.class.isAssignableFrom(clazz)) {
+ } else if (Duration.class.isAssignableFrom(clazz)) {
+ return X_AS_PROPERTY;
+ } else if (FileSize.class.isAssignableFrom(clazz)) {
return X_AS_PROPERTY;
- }else {
+ } else {
return X_AS_COMPONENT;
}
}
@@ -289,7 +291,7 @@
name = capitalizeFirstLetter(name);
Method adderMethod = getMethod("add" + name);
-
+
if (adderMethod == null) {
addError("No adder for property [" + name + "].");
return;
@@ -309,7 +311,6 @@
return;
}
-
if (arg == null) {
addError("Conversion to type [" + paramTypes[0] + "] failed.");
} else {
@@ -392,8 +393,10 @@
} else if ("false".equalsIgnoreCase(v)) {
return Boolean.FALSE;
}
- } else if(Duration.class.isAssignableFrom(type)) {
+ } else if (Duration.class.isAssignableFrom(type)) {
return Duration.valueOf(val);
+ } else if (FileSize.class.isAssignableFrom(type)) {
+ return FileSize.valueOf(val);
}
return null;
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java Wed Nov 15 09:53:36 2006
@@ -20,6 +20,7 @@
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Name"));
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Duration"));
+ assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("fs"));
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("open"));
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Open"));
@@ -114,7 +115,13 @@
setter.setProperty("duration", "1.4 seconds");
assertEquals(1400, house.getDuration().getMilliSeconds());
}
-
+
+ public void testFileSize() {
+ House house = new House();
+ PropertySetter setter = new PropertySetter(house);
+ setter.setProperty("fs", "2 kb");
+ assertEquals(2*1024, house.getFs().getSize());
+ }
}
class House {
@@ -125,6 +132,7 @@
String camelCase;
SwimmingPool pool;
Duration duration;
+ FileSize fs;
List<String> adjectiveList = new ArrayList<String>();
List<Window> windowList = new ArrayList<Window>();
@@ -193,6 +201,14 @@
public void setDuration(Duration duration) {
this.duration = duration;
}
+
+ public FileSize getFs() {
+ return fs;
+ }
+
+ public void setFs(FileSize fs) {
+ this.fs = fs;
+ }
}
class Door {
1
0

svn commit: r917 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/util test/java/ch/qos/logback/core/util
by noreply.ceki@qos.ch 14 Nov '06
by noreply.ceki@qos.ch 14 Nov '06
14 Nov '06
Author: ceki
Date: Tue Nov 14 17:58:17 2006
New Revision: 917
Added:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/FileSizeTest.java
Log:
adding support for filesize
Added: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/FileSize.java Tue Nov 14 17:58:17 2006
@@ -0,0 +1,68 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework for Java.
+ *
+ * Copyright (C) 2000-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.core.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class FileSize {
+
+ private final static String LENGTH_PART = "([0-9]+)";
+ private final static int DOUBLE_GROUP = 1;
+
+ private final static String UNIT_PART = "(|kb|mb|gb)s?";
+ private final static int UNIT_GROUP = 2;
+
+ private static final Pattern FILE_SIZE_PATTERN = Pattern.compile(LENGTH_PART
+ + "\\s*" + UNIT_PART, Pattern.CASE_INSENSITIVE);
+
+ static final long KB_COEFFICIENT = 1024;
+ static final long MB_COEFFICIENT = 1024 * KB_COEFFICIENT;
+ static final long GB_COEFFICIENT = 1024 * MB_COEFFICIENT;
+
+
+ final long size;
+
+ FileSize(long size) {
+ this.size = size;
+ }
+
+ long getSize() {
+ return size;
+ }
+
+ static FileSize valueOf(String fileSizeStr) {
+ Matcher matcher = FILE_SIZE_PATTERN.matcher(fileSizeStr);
+
+ long coefficient;
+ if (matcher.matches()) {
+ String lenStr = matcher.group(DOUBLE_GROUP);
+ String unitStr = matcher.group(UNIT_GROUP);
+
+ long lenValue = Long.valueOf(lenStr);
+ if (unitStr.equalsIgnoreCase("")) {
+ coefficient = 1;
+ } else if (unitStr.equalsIgnoreCase("kb")) {
+ coefficient = KB_COEFFICIENT;
+ } else if (unitStr.equalsIgnoreCase("mb")) {
+ coefficient = MB_COEFFICIENT;
+ } else if (unitStr.equalsIgnoreCase("gb")) {
+ coefficient = GB_COEFFICIENT;
+ } else {
+ throw new IllegalStateException("Unexpected " + unitStr);
+ }
+ return new FileSize(lenValue * coefficient);
+ } else {
+ throw new IllegalArgumentException("String value [" + fileSizeStr
+ + "] is not in the expected format.");
+ }
+
+ }
+}
Added: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/FileSizeTest.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/FileSizeTest.java Tue Nov 14 17:58:17 2006
@@ -0,0 +1,60 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework for Java.
+ *
+ * Copyright (C) 2000-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+
+package ch.qos.logback.core.util;
+
+import junit.framework.TestCase;
+
+public class FileSizeTest extends TestCase {
+
+ static long KB_CO = 1024;
+ static long MB_CO = 1024*1024;
+ static long GB_CO = 1024*MB_CO;
+
+ public FileSizeTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void test() {
+ {
+ FileSize fs = FileSize.valueOf("8");
+ assertEquals(8, fs.getSize());
+ }
+
+ {
+ FileSize fs = FileSize.valueOf("8 kbs");
+ assertEquals(8*KB_CO, fs.getSize());
+ }
+
+ {
+ FileSize fs = FileSize.valueOf("8 kb");
+ assertEquals(8*KB_CO, fs.getSize());
+ }
+
+ {
+ FileSize fs = FileSize.valueOf("12 mb");
+ assertEquals(12*MB_CO, fs.getSize());
+ }
+
+ {
+ FileSize fs = FileSize.valueOf("5 GBs");
+ assertEquals(5*GB_CO, fs.getSize());
+ }
+
+ }
+}
1
0

svn commit: r916 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/util test/java/ch/qos/logback/core/util
by noreply.ceki@qos.ch 14 Nov '06
by noreply.ceki@qos.ch 14 Nov '06
14 Nov '06
Author: ceki
Date: Tue Nov 14 17:37:41 2006
New Revision: 916
Added:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java
Modified:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
Log:
added support for setting duration values from strings
Added: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/Duration.java Tue Nov 14 17:37:41 2006
@@ -0,0 +1,70 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework for Java.
+ *
+ * Copyright (C) 2000-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.core.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Duration {
+
+ private final static String DOUBLE_PART = "([0-9]*(.[0-9]+)?)";
+ private final static int DOUBLE_GROUP = 1;
+
+ private final static String UNIT_PART = "(millisecond|second|minute|hour|day)s?";
+ private final static int UNIT_GROUP = 3;
+
+ private static final Pattern DURATION_PATTERN = Pattern.compile(DOUBLE_PART
+ + "\\s*" + UNIT_PART, Pattern.CASE_INSENSITIVE);
+
+ static final long SECONDS_COEFFICIENT = 1000;
+ static final long MINUTES_COEFFICIENT = 60 * SECONDS_COEFFICIENT;
+ static final long HOURS_COEFFICIENT = 60 * MINUTES_COEFFICIENT;
+ static final long DAYS_COEFFICIENT = 24 * HOURS_COEFFICIENT;
+
+ final long millis;
+
+ Duration(long millis) {
+ this.millis = millis;
+ }
+
+ long getMilliSeconds() {
+ return millis;
+ }
+
+ static Duration valueOf(String durationStr) {
+ Matcher matcher = DURATION_PATTERN.matcher(durationStr);
+
+ long coefficient;
+ if (matcher.matches()) {
+ String doubleStr = matcher.group(DOUBLE_GROUP);
+ String unitStr = matcher.group(UNIT_GROUP);
+
+ double doubleValue = Double.valueOf(doubleStr);
+ if (unitStr.equalsIgnoreCase("millisecond")) {
+ coefficient = 1;
+ } else if (unitStr.equalsIgnoreCase("second")) {
+ coefficient = SECONDS_COEFFICIENT;
+ } else if (unitStr.equalsIgnoreCase("minute")) {
+ coefficient = MINUTES_COEFFICIENT;
+ } else if (unitStr.equalsIgnoreCase("hour")) {
+ coefficient = HOURS_COEFFICIENT;
+ } else if (unitStr.equalsIgnoreCase("day")) {
+ coefficient = DAYS_COEFFICIENT;
+ } else {
+ throw new IllegalStateException("Unexpected" + unitStr);
+ }
+ return new Duration((long) (doubleValue * coefficient));
+ } else {
+ throw new IllegalArgumentException("String value [" + durationStr
+ + "] is not in the expected format.");
+ }
+
+ }
+}
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/util/PropertySetter.java Tue Nov 14 17:37:41 2006
@@ -231,7 +231,9 @@
return X_AS_PROPERTY;
} else if ("java.lang".equals(p.getName())) {
return X_AS_PROPERTY;
- } else {
+ } else if(Duration.class.isAssignableFrom(clazz)) {
+ return X_AS_PROPERTY;
+ }else {
return X_AS_COMPONENT;
}
}
@@ -390,6 +392,8 @@
} else if ("false".equalsIgnoreCase(v)) {
return Boolean.FALSE;
}
+ } else if(Duration.class.isAssignableFrom(type)) {
+ return Duration.valueOf(val);
}
return null;
Added: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/DurationTest.java Tue Nov 14 17:37:41 2006
@@ -0,0 +1,78 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework for Java.
+ *
+ * Copyright (C) 2000-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+
+package ch.qos.logback.core.util;
+
+import junit.framework.TestCase;
+
+public class DurationTest extends TestCase {
+
+ static long HOURS_CO = 60*60;
+ static long DAYS_CO = 24*60*60;
+
+ public DurationTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void test() {
+ {
+ Duration d = Duration.valueOf("8 milliseconds");
+ assertEquals(8, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("10.7 millisecond");
+ assertEquals(10, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("10 seconds");
+ assertEquals(10 * 1000, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("10.7 seconds");
+ assertEquals(10700, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("1 minute");
+ assertEquals(1000*60, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("2.2 minutes");
+ assertEquals(2200*60, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("1 hour");
+ assertEquals(1000*HOURS_CO, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("4.2 hours");
+ assertEquals(4200*HOURS_CO, d.getMilliSeconds());
+ }
+
+ {
+ Duration d = Duration.valueOf("5 days");
+ assertEquals(5000*DAYS_CO, d.getMilliSeconds());
+ }
+ }
+}
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java Tue Nov 14 17:37:41 2006
@@ -19,12 +19,15 @@
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("name"));
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Name"));
+ assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Duration"));
+
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("open"));
assertEquals(ContainmentType.AS_SINGLE_PROPERTY, setter.canContainComponent("Open"));
assertEquals(ContainmentType.AS_COMPONENT_COLLECTION, setter.canContainComponent("Window"));
assertEquals(ContainmentType.AS_PROPERTY_COLLECTION, setter.canContainComponent("adjective"));
+
}
public void testSetProperty() {
@@ -105,6 +108,13 @@
assertEquals(pool, house.getSwimmingPool());
}
+ public void testDuration() {
+ House house = new House();
+ PropertySetter setter = new PropertySetter(house);
+ setter.setProperty("duration", "1.4 seconds");
+ assertEquals(1400, house.getDuration().getMilliSeconds());
+ }
+
}
class House {
@@ -114,6 +124,7 @@
String name;
String camelCase;
SwimmingPool pool;
+ Duration duration;
List<String> adjectiveList = new ArrayList<String>();
List<Window> windowList = new ArrayList<Window>();
@@ -174,6 +185,14 @@
public void addAdjective(String s) {
adjectiveList.add(s);
}
+
+ public Duration getDuration() {
+ return duration;
+ }
+
+ public void setDuration(Duration duration) {
+ this.duration = duration;
+ }
}
class Door {
1
0
Online report : http://localhost:8090/continuum/servlet/continuum/target/ProjectBuild.vm/vi…
Build statistics:
State: Ok
Previous State: Failed
Started at: Tue, 14 Nov 2006 16:40:21 +0100
Finished at: Tue, 14 Nov 2006 16:40:36 +0100
Total time: 15s
Build Trigger: Schedule
Exit code: 0
Building machine hostname: pixie
Operating system : Linux(unknown)
Java version : 1.5.0_08(Sun Microsystems Inc.)
Changes
seb moved sql scripts to classic
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2l.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/deleteTables.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/hsqldb.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mssql.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mysql.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql
/logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/db2.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/db2l.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/deleteTables.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/hsqldb.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/mssql.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/mysql.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/oracle.sql
/logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/postgresql.sql
****************************************************************************
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.103 sec
Running ch.qos.logback.classic.control.CLCTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
Running ch.qos.logback.classic.LoggerContextTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec
Running ch.qos.logback.classic.pattern.ClassNameAbbreviatorTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running ch.qos.logback.classic.pattern.MDCConverterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
Running ch.qos.logback.classic.MDCTest
Exiting a
Exiting b
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 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.016 sec
Running ch.qos.logback.classic.PatternLayoutTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec
Running ch.qos.logback.classic.MessageFormattingTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
Running ch.qos.logback.classic.boolex.JaninoEventEvaluatorTest
INFO] Some message
INFO] Some message
timestamp > 10]: 10482 nanos
x.matches(message): 20270 nanos
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.585 sec
Running ch.qos.logback.classic.net.SMTPAppenderTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running ch.qos.logback.classic.joran.EvaluatorJoranTest
|-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-14 16:40:32,101 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-14 16:40:32,102 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@54acb158 - 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.087 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.128 sec
Running ch.qos.logback.classic.DynamicLoggerContextTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.624 sec
Running ch.qos.logback.classic.control.TestAction
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
Running ch.qos.logback.classic.db.DBAppenderTest
[Server@15f48262]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@15f48262]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@15f48262]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@15f48262]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@15f48262]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@15f48262]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
[Server@66941db6]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@66941db6]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@66941db6]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@66941db6]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@66941db6]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@66941db6]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
[Server@12d56b37]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@12d56b37]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@12d56b37]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@12d56b37]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@12d56b37]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@12d56b37]: [Thread[main,5,main]]: setDatabasePath(0,mem:test;sql.enforce_strict_size=true)
value: someValue
[Server@2880cac9]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@2880cac9]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@2880cac9]: [Thread[main,5,main]]: setDatabaseName(0,test)
[Server@2880cac9]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@2880cac9]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@2880cac9]: [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.924 sec
Running ch.qos.logback.classic.util.InitializationTest
TEST 16:40:33.846 [main] DEBUG c.q.l.c.util.InitializationTest - Hello-didily-odily
TEST 16:40:33.847 [main] DEBUG c.q.l.c.util.InitializationTest - Hello-didily-odily
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 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: 21.0 nanos.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.683 sec
Running ch.qos.logback.classic.html.HTMLLayoutTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.356 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.093 sec
Running ch.qos.logback.classic.net.SocketAppenderTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.436 sec
Running ch.qos.logback.classic.net.SyslogAppenderTest
MockSyslogServer listening on port 14501
MockSyslogServer listening on port 14502
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.221 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.036 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.
|-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-14 16:40:35,737 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-14 16:40:35,738 DEBUG - hello world
|-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]
|-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.087 sec
Results :
Tests run: 103, 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: Tue Nov 14 16:40:36 CET 2006
[INFO] Final Memory: 13M/147M
[INFO] ------------------------------------------------------------------------
****************************************************************************
1
0
Online report : http://localhost:8090/continuum/servlet/continuum/target/ProjectBuild.vm/vi…
Build statistics:
State: Ok
Previous State: Failed
Started at: Tue, 14 Nov 2006 16:39:53 +0100
Finished at: Tue, 14 Nov 2006 16:40:06 +0100
Total time: 13s
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 added dependency to janino
/logback/trunk/logback-access/pom.xml
****************************************************************************
Output:
****************************************************************************
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Logback Access Module
[INFO] task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/47/target
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/classes
[INFO] Deleting directory /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 41 source files to /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
Compiling 12 source files to /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running ch.qos.logback.access.jetty.JettyBasicTest
2006-11-14 16:40:04.468::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2006-11-14 16:40:04.531::INFO: jetty-6.0.x
2006-11-14 16:40:04.591::INFO: Started SelectChannelConnector @ 0.0.0.0:1234
14/11/2006:16:40:04 +0100 localhost 127.0.0.1
14/11/2006:16:40:04 +0100 localhost 127.0.0.1
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.282 sec
Running ch.qos.logback.access.pattern.ConverterTest
Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec
Running ch.qos.logback.access.net.DefaultSMTPEvaluatorTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.189 sec
Results :
Tests run: 21, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar]
[INFO] Building jar: /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/logback-access-0.6-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing /opt/continuum-1.0.3/apps/continuum/working-directory/47/target/logback-access-0.6-SNAPSHOT.jar to /root/.m2/repository/ch/qos/logback/logback-access/0.6-SNAPSHOT/logback-access-0.6-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Nov 14 16:40:06 CET 2006
[INFO] Final Memory: 12M/144M
[INFO] ------------------------------------------------------------------------
****************************************************************************
1
0
Author: seb
Date: Tue Nov 14 16:33:28 2006
New Revision: 915
Modified:
logback/trunk/logback-access/pom.xml
Log:
added dependency to janino
Modified: logback/trunk/logback-access/pom.xml
==============================================================================
--- logback/trunk/logback-access/pom.xml (original)
+++ logback/trunk/logback-access/pom.xml Tue Nov 14 16:33:28 2006
@@ -61,6 +61,12 @@
<artifactId>servlet-api-2.5</artifactId>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
1
0

svn commit: r914 - in logback/trunk: logback-classic/src/main/java/ch/qos/logback/classic/db/dialect logback-core/src/main/java/ch/qos/logback/core/db/dialect
by noreply.seb@qos.ch 14 Nov '06
by noreply.seb@qos.ch 14 Nov '06
14 Nov '06
Author: seb
Date: Tue Nov 14 16:25:22 2006
New Revision: 914
Added:
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2l.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/deleteTables.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/hsqldb.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mssql.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mysql.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
Removed:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/db2.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/db2l.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/deleteTables.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/hsqldb.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/mssql.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/mysql.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/oracle.sql
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/postgresql.sql
Log:
moved sql scripts to classic
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,48 @@
+# This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
+#
+# It is intended for IBM DB2 databases.
+#
+# WARNING WARNING WARNING WARNING
+# =================================
+# This SQL script has not been tested on an actual DB2
+# instance. It may contain errors or even invalid SQL
+# statements.
+
+DROP TABLE logging_event_property;
+DROP TABLE logging_event_exception;
+DROP TABLE logging_event;
+
+CREATE TABLE logging_event
+ (
+ sequence_number BIGINT NOT NULL,
+ timestamp BIGINT NOT NULL,
+ rendered_message VARCHAR(4000) NOT NULL,
+ logger_name VARCHAR(254) NOT NULL,
+ level_string VARCHAR(254) NOT NULL,
+ ndc VARCHAR(4000),
+ thread_name VARCHAR(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(254) NOT NULL,
+ caller_class VARCHAR(254) NOT NULL,
+ caller_method VARCHAR(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 1)
+ );
+
+CREATE TABLE logging_event_property
+ (
+ event_id INTEGER NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value VARCHAR(1024),
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+CREATE TABLE logging_event_exception
+ (
+ event_id INTEGER NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2l.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/db2l.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,46 @@
+# This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
+#
+# It is intended for PostgreSQL databases.
+
+DROP TABLE logging_event_property;
+DROP TABLE logging_event_exception;
+DROP TABLE logging_event;
+
+
+CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START 1;
+
+
+CREATE TABLE logging_event
+ (
+ sequence_number BIGINT NOT NULL,
+ timestamp BIGINT NOT NULL,
+ rendered_message TEXT NOT NULL,
+ logger_name VARCHAR(254) NOT NULL,
+ level_string VARCHAR(254) NOT NULL,
+ ndc TEXT,
+ thread_name VARCHAR(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(254) NOT NULL,
+ caller_class VARCHAR(254) NOT NULL,
+ caller_method VARCHAR(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id INT IDENTITY GENERATED ALWAYS PRIMARY KEY
+ );
+
+CREATE TABLE logging_event_property
+ (
+ event_id INT NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value VARCHAR(1024),
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+CREATE TABLE logging_event_exception
+ (
+ event_id INT NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/deleteTables.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/deleteTables.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,4 @@
+
+delete from logging_event_exception;
+delete from logging_event_property;
+delete from logging_event;
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/hsqldb.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/hsqldb.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,44 @@
+// This SQL script creates the required tables by
+// ch.qos.logback.classic.db.DBAppender.
+//
+// It is intended for HSQLDB.
+//
+
+DROP TABLE logging_event_exception IF EXISTS;
+DROP TABLE logging_event_property IF EXISTS;
+DROP TABLE logging_event IF EXISTS;
+
+
+CREATE TABLE logging_event
+ (
+ timestmp BIGINT NOT NULL,
+ formatted_message LONGVARCHAR NOT NULL,
+ logger_name VARCHAR(256) NOT NULL,
+ level_string VARCHAR(256) NOT NULL,
+ thread_name VARCHAR(256),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(256),
+ caller_class VARCHAR(256),
+ caller_method VARCHAR(256),
+ caller_line CHAR(4),
+ event_id INT NOT NULL IDENTITY
+ );
+
+
+CREATE TABLE logging_event_property
+ (
+ event_id INT NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value LONGVARCHAR,
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+CREATE TABLE logging_event_exception
+ (
+ event_id INT NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(256) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mssql.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mssql.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,44 @@
+-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
+--
+-- It is intended for MS SQL Server databases. This has been tested with version 7.0.
+
+DROP TABLE logging_event_property
+DROP TABLE logging_event_exception
+DROP TABLE logging_event
+
+CREATE TABLE logging_event
+ (
+ sequence_number DECIMAL(20) NOT NULL,
+ timestamp DECIMAL(20) NOT NULL,
+ rendered_message VARCHAR(4000) NOT NULL,
+ logger_name VARCHAR(254) NOT NULL,
+ level_string VARCHAR(254) NOT NULL,
+ ndc VARCHAR(4000),
+ thread_name VARCHAR(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(254) NOT NULL,
+ caller_class VARCHAR(254) NOT NULL,
+ caller_method VARCHAR(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id INT NOT NULL identity,
+ PRIMARY KEY(event_id)
+ )
+
+CREATE TABLE logging_event_property
+ (
+ event_id INT NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value VARCHAR(1024),
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ )
+
+CREATE TABLE logging_event_exception
+ (
+ event_id INT NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ )
+
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mysql.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/mysql.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,51 @@
+# This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender.
+#
+# It is intended for MySQL databases. It has been tested on MySQL 5.0.22 with
+# INNODB tables.
+
+
+BEGIN;
+DROP TABLE IF EXISTS logging_event_property;
+DROP TABLE IF EXISTS logging_event_exception;
+DROP TABLE IF EXISTS logging_event;
+COMMIT;
+
+
+BEGIN;
+CREATE TABLE logging_event
+ (
+ timestmp BIGINT NOT NULL,
+ formatted_message TEXT NOT NULL,
+ logger_name VARCHAR(254) NOT NULL,
+ level_string VARCHAR(254) NOT NULL,
+ thread_name VARCHAR(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(254) NOT NULL,
+ caller_class VARCHAR(254) NOT NULL,
+ caller_method VARCHAR(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
+ );
+COMMIT;
+
+BEGIN;
+CREATE TABLE logging_event_property
+ (
+ event_id INT NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value TEXT,
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+COMMIT;
+
+BEGIN;
+CREATE TABLE logging_event_exception
+ (
+ event_id INT NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+COMMIT;
\ No newline at end of file
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,66 @@
+-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
+--
+-- It is intended for Oracle databases.
+
+-- Tested successfully on Oracle9i Release 9.2.0.3.0 by James Stauffer
+
+-- The following lines are useful in cleaning any previous tables
+
+--drop TRIGGER logging_event_id_seq_trig;
+--drop SEQUENCE logging_event_id_seq;
+--drop table logging_event_property;
+--drop table logging_event_exception;
+--drop table logging_event;
+
+
+CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;
+
+CREATE TABLE logging_event
+ (
+ sequence_number NUMBER(20) NOT NULL,
+ timestamp NUMBER(20) NOT NULL,
+ rendered_message VARCHAR2(4000) NOT NULL,
+ logger_name VARCHAR2(254) NOT NULL,
+ level_string VARCHAR2(254) NOT NULL,
+ ndc VARCHAR2(4000),
+ thread_name VARCHAR2(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR2(254) NOT NULL,
+ caller_class VARCHAR2(254) NOT NULL,
+ caller_method VARCHAR2(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id NUMBER(10) PRIMARY KEY
+ );
+
+
+CREATE TRIGGER logging_event_id_seq_trig
+ BEFORE INSERT ON logging_event
+ FOR EACH ROW
+ BEGIN
+ SELECT logging_event_id_seq.NEXTVAL
+ INTO :NEW.event_id
+ FROM DUAL;
+ END logging_event_id_seq_trig;
+
+
+CREATE TABLE logging_event_property
+ (
+ event_id NUMBER(10) NOT NULL,
+ mapped_key VARCHAR2(254) NOT NULL,
+ mapped_value VARCHAR2(1024),
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+CREATE TABLE logging_event_exception
+ (
+ event_id NUMBER(10) NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR2(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+
+
+
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql Tue Nov 14 16:25:22 2006
@@ -0,0 +1,47 @@
+# This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
+#
+# It is intended for PostgreSQL databases.
+
+DROP TABLE logging_event_property;
+DROP TABLE logging_event_exception;
+DROP SEQUENCE logging_event_id_seq;
+DROP TABLE logging_event;
+
+
+CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START 1;
+
+
+CREATE TABLE logging_event
+ (
+ sequence_number BIGINT NOT NULL,
+ timestamp BIGINT NOT NULL,
+ rendered_message TEXT NOT NULL,
+ logger_name VARCHAR(254) NOT NULL,
+ level_string VARCHAR(254) NOT NULL,
+ ndc TEXT,
+ thread_name VARCHAR(254),
+ reference_flag SMALLINT,
+ caller_filename VARCHAR(254) NOT NULL,
+ caller_class VARCHAR(254) NOT NULL,
+ caller_method VARCHAR(254) NOT NULL,
+ caller_line CHAR(4) NOT NULL,
+ event_id INT DEFAULT nextval('logging_event_id_seq') PRIMARY KEY
+ );
+
+CREATE TABLE logging_event_property
+ (
+ event_id INT NOT NULL,
+ mapped_key VARCHAR(254) NOT NULL,
+ mapped_value VARCHAR(1024),
+ PRIMARY KEY(event_id, mapped_key),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
+
+CREATE TABLE logging_event_exception
+ (
+ event_id INT NOT NULL,
+ i SMALLINT NOT NULL,
+ trace_line VARCHAR(254) NOT NULL,
+ PRIMARY KEY(event_id, i),
+ FOREIGN KEY (event_id) REFERENCES logging_event(event_id)
+ );
1
0