[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v0.9.18-105-g39dbbf9
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Mon Mar 22 15:40:10 CET 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".
The branch, master has been updated
via 39dbbf9a5f7d414db63e89b18d09d04fd0ae6498 (commit)
from d3a98f905ea1bffb7afda7fb4405c28238635a57 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=39dbbf9a5f7d414db63e89b18d09d04fd0ae6498
http://github.com/ceki/logback/commit/39dbbf9a5f7d414db63e89b18d09d04fd0ae6498
commit 39dbbf9a5f7d414db63e89b18d09d04fd0ae6498
Author: Ceki Gulcu <ceki at qos.ch>
Date: Mon Mar 22 15:37:28 2010 +0100
- The virtual host 'gimmel' got corrupted and was resuscitated as
'haro'.
FileAppenderResilience_AS_ROOT_Test and postgresql() in
DBAppenderIntegrationTest now run on 'haro'.
- Fixed LBCORE-126 by lowercasing the EVENT_ID column name in
prepared statements for PostgreSQL.
- corrected a few compiler warnings for "raw types"
- updated to PostgreSQL JDBC driver to 8.4-701.jdbc4
diff --git a/logback-classic/pom.xml b/logback-classic/pom.xml
index bdb2ec6..41559e0 100644
--- a/logback-classic/pom.xml
+++ b/logback-classic/pom.xml
@@ -82,6 +82,12 @@
</dependency>
<dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<scope>compile</scope>
@@ -304,12 +310,6 @@ org.slf4j.test_osgi
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.2-507.jdbc3</version>
- </dependency>
-
<!-- locally installed artifact -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
@@ -330,4 +330,4 @@ org.slf4j.test_osgi
</profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java b/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
index e055c5b..e563109 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/db/DBAppender.java
@@ -85,7 +85,7 @@ public class DBAppender extends DBAppenderBase<ILoggingEvent> {
bindLoggingEventWithInsertStatement(insertStatement, event);
// This is expensive... should we do it every time?
bindCallerDataWithPreparedStatement(insertStatement, event.getCallerData());
-
+
int updateCount = insertStatement.executeUpdate();
if (updateCount != 1) {
addWarn("Failed to insert loggingEvent");
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql b/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
index 3f2ce1b..55c7343 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/postgresql.sql
@@ -1,11 +1,11 @@
-# This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
-#
-# It is intended for PostgreSQL databases.
+-- 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;
+DROP SEQUENCE logging_event_id_seq;
CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START 1;
diff --git a/logback-classic/src/test/input/integration/db/postgresql-with-driver.xml b/logback-classic/src/test/input/integration/db/postgresql-with-driver.xml
index ce5a3cf..976ddc7 100644
--- a/logback-classic/src/test/input/integration/db/postgresql-with-driver.xml
+++ b/logback-classic/src/test/input/integration/db/postgresql-with-driver.xml
@@ -2,17 +2,17 @@
<configuration>
- <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
- <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
- <driverClass>org.postgresql.Driver</driverClass>
- <url>jdbc:postgresql://192.168.1.5:5432/test</url>
- <user>logback</user>
- <password>logback</password>
- </connectionSource>
- </appender>
-
- <root>
- <level value="debug" />
- <appender-ref ref="DB" />
- </root>
+ <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+ <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
+ <driverClass>org.postgresql.Driver</driverClass>
+ <url>jdbc:postgresql://localhost:5432/test</url>
+ <user>test</user>
+ <password>test</password>
+ </connectionSource>
+ </appender>
+
+ <root>
+ <level value="debug" />
+ <appender-ref ref="DB" />
+ </root>
</configuration>
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java
index e2852b9..8ede4bc 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java
@@ -36,7 +36,7 @@ import ch.qos.logback.core.pattern.PatternLayoutBase;
import ch.qos.logback.core.pattern.parser.AbstractPatternLayoutBaseTest;
import ch.qos.logback.core.testUtil.StringListAppender;
-public class PatternLayoutTest extends AbstractPatternLayoutBaseTest {
+public class PatternLayoutTest extends AbstractPatternLayoutBaseTest<ILoggingEvent> {
private PatternLayout pl = new PatternLayout();
private LoggerContext lc = new LoggerContext();
@@ -44,7 +44,7 @@ public class PatternLayoutTest extends AbstractPatternLayoutBaseTest {
Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
ILoggingEvent le;
- List optionList = new ArrayList();
+ List<String> optionList = new ArrayList<String>();
public PatternLayoutTest() {
super();
@@ -68,7 +68,7 @@ public class PatternLayoutTest extends AbstractPatternLayoutBaseTest {
return makeLoggingEvent(null);
}
- public PatternLayoutBase getPatternLayoutBase() {
+ public PatternLayoutBase<ILoggingEvent> getPatternLayoutBase() {
return new PatternLayout();
}
@@ -170,7 +170,7 @@ public class PatternLayoutTest extends AbstractPatternLayoutBaseTest {
root.getAppender("LIST");
String msg = "Simon says";
logger.debug(msg);
- StringListAppender sla = (StringListAppender) root.getAppender("LIST");
+ StringListAppender<ILoggingEvent> sla = (StringListAppender<ILoggingEvent>) root.getAppender("LIST");
assertNotNull(sla);
assertEquals(1, sla.strList.size());
assertEquals(SampleConverter.SAMPLE_STR+" - "+msg, sla.strList.get(0));
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
index f603972..5d1f26b 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
@@ -38,10 +38,11 @@ public class DBAppenderIntegrationTest {
static String LOCAL_HOST_NAME;
static String[] CONFORMING_HOST_LIST = new String[] { "Orion" };
+ static String[] POSTGRES_CONFORMING_HOST_LIST = new String[] { "haro" };
int diff = new Random(System.nanoTime()).nextInt(10000);
LoggerContext lc = new LoggerContext();
-
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
InetAddress localhostIA = InetAddress.getLocalHost();
@@ -54,7 +55,7 @@ public class DBAppenderIntegrationTest {
@Before
public void setUp() throws Exception {
- lc.setName("lc"+diff);
+ lc.setName("lc" + diff);
}
@After
@@ -76,18 +77,18 @@ public class DBAppenderIntegrationTest {
logger.debug("This is a debug message. Message number: " + i);
}
logger.error("At last an error.", new Exception("Just testing"));
-
+
// check that there were no errors
StatusPrinter.print(lc);
assertEquals(Status.INFO, lc.getStatusManager().getLevel());
-
+
}
-
- static boolean isConformingHostAndJDK16OrHigher() {
- if(!Env.isJDK6OrHigher()) {
+
+ static boolean isConformingHostAndJDK16OrHigher(String[] conformingHostList) {
+ if (!Env.isJDK6OrHigher()) {
return false;
}
- for (String conformingHost : CONFORMING_HOST_LIST) {
+ for (String conformingHost : conformingHostList) {
if (conformingHost.equalsIgnoreCase(LOCAL_HOST_NAME)) {
return true;
}
@@ -95,6 +96,10 @@ public class DBAppenderIntegrationTest {
return false;
}
+ static boolean isConformingHostAndJDK16OrHigher() {
+ return isConformingHostAndJDK16OrHigher(CONFORMING_HOST_LIST);
+ }
+
@Test
public void sqlserver() throws Exception {
// perform test only on conforming hosts
@@ -123,7 +128,7 @@ public class DBAppenderIntegrationTest {
}
doTest("src/test/input/integration/db/oracle11g-with-driver.xml");
}
-
+
@Test
public void mysql() throws Exception {
// perform test only on conforming hosts
@@ -132,14 +137,15 @@ public class DBAppenderIntegrationTest {
}
doTest("src/test/input/integration/db/mysql-with-driver.xml");
}
-
+
@Test
public void postgres() throws Exception {
// perform test only on conforming hosts
- if (!isConformingHostAndJDK16OrHigher()) {
+ if (!isConformingHostAndJDK16OrHigher(POSTGRES_CONFORMING_HOST_LIST)) {
return;
}
+ System.out.println("doing test");
doTest("src/test/input/integration/db/postgresql-with-driver.xml");
}
-
+
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java
index cfd81ca..519c1eb 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/util/InitializationTest.java
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.ClassicTestConstants;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ConsoleAppender;
import ch.qos.logback.core.joran.spi.JoranException;
@@ -60,7 +61,7 @@ public class InitializationTest {
// However, this is something we try to avoid in order to simplify the life
// of users trying to follows the manual and logback-examples from an IDE
public void atoconfig() {
- Appender appender = root.getAppender("STDOUT");
+ Appender<ILoggingEvent> appender = root.getAppender("STDOUT");
assertNotNull(appender);
assertTrue(appender instanceof ConsoleAppender);
}
@@ -79,7 +80,7 @@ public class InitializationTest {
}
{
lc.stop();
- Appender appender = root.getAppender("STDOUT");
+ Appender<ILoggingEvent> appender = root.getAppender("STDOUT");
assertNull(appender);
}
}
@@ -96,7 +97,7 @@ public class InitializationTest {
//lc.reset();
System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, val);
new ContextInitializer(lc).autoConfig();
- Appender appender = root.getAppender("AUTO_BY_SYSTEM_PROPERTY");
+ Appender<ILoggingEvent> appender = root.getAppender("AUTO_BY_SYSTEM_PROPERTY");
assertNotNull(appender);
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/db/DBAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/db/DBAppenderBase.java
index bcac3ef..be8bc33 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/db/DBAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/db/DBAppenderBase.java
@@ -24,6 +24,7 @@ import java.sql.Statement;
import ch.qos.logback.core.AppenderBase;
import ch.qos.logback.core.db.dialect.DBUtil;
import ch.qos.logback.core.db.dialect.SQLDialect;
+import ch.qos.logback.core.db.dialect.SQLDialectCode;
/**
* @author Ceki Gülcü
@@ -82,6 +83,7 @@ public abstract class DBAppenderBase<E> extends AppenderBase<E> {
this.connectionSource = connectionSource;
}
+
@Override
public void append(E eventObject) {
Connection connection = null;
@@ -90,8 +92,13 @@ public abstract class DBAppenderBase<E> extends AppenderBase<E> {
connection.setAutoCommit(false);
PreparedStatement insertStatement;
if (cnxSupportsGetGeneratedKeys) {
+ String EVENT_ID_COL_NAME = "EVENT_ID";
+ // see
+ if(connectionSource.getSQLDialectCode() == SQLDialectCode.POSTGRES_DIALECT) {
+ EVENT_ID_COL_NAME = EVENT_ID_COL_NAME.toLowerCase();
+ }
insertStatement = connection.prepareStatement(getInsertSQL(),
- new String[] {"EVENT_ID"});
+ new String[] {EVENT_ID_COL_NAME});
} else {
insertStatement = connection.prepareStatement(getInsertSQL());
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java b/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
index 4697b55..ca86f4c 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/sift/AppenderTrackerImpl.java
@@ -91,7 +91,7 @@ public class AppenderTrackerImpl<E> implements AppenderTracker<E> {
if(found != null) {
rearrangePreexistingLinks(e);
map.remove(key);
- Appender appender = e.value;
+ Appender<E> appender = e.value;
appender.stop();
}
}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilience_AS_ROOT_Test.java b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilience_AS_ROOT_Test.java
index a5a7691..2e39ae6 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilience_AS_ROOT_Test.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilience_AS_ROOT_Test.java
@@ -47,7 +47,7 @@ public class FileAppenderResilience_AS_ROOT_Test {
FileAppender<Object> fa = new FileAppender<Object>();
static boolean isConformingHost() {
- return Env.isLocalHostNameInList(new String[] { "gimmel" });
+ return Env.isLocalHostNameInList(new String[] { "haro" });
}
@Before
diff --git a/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java b/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
index 8bed2f4..edd5466 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
@@ -22,7 +22,7 @@ import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.pattern.PatternLayoutBase;
-public class SamplePatternLayoutTest extends AbstractPatternLayoutBaseTest {
+public class SamplePatternLayoutTest extends AbstractPatternLayoutBaseTest<Object> {
Context context = new ContextBase();
diff --git a/pom.xml b/pom.xml
index d083acf..7f1e6ea 100755
--- a/pom.xml
+++ b/pom.xml
@@ -93,12 +93,11 @@
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
</dependency>
-
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.2.131</version>
- </dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.4-701.jdbc4</version>
+ </dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>catalina</artifactId>
@@ -125,10 +124,10 @@
<version>1.0</version>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -362,4 +361,4 @@
</profiles>
-</project>
\ No newline at end of file
+</project>
-----------------------------------------------------------------------
Summary of changes:
logback-classic/pom.xml | 14 ++++----
.../java/ch/qos/logback/classic/db/DBAppender.java | 2 +-
.../qos/logback/classic/db/dialect/postgresql.sql | 8 ++--
.../integration/db/postgresql-with-driver.xml | 26 ++++++++--------
.../ch/qos/logback/classic/PatternLayoutTest.java | 8 ++--
.../classic/db/DBAppenderIntegrationTest.java | 30 ++++++++++++--------
.../logback/classic/util/InitializationTest.java | 7 ++--
.../ch/qos/logback/core/db/DBAppenderBase.java | 9 +++++-
.../qos/logback/core/sift/AppenderTrackerImpl.java | 2 +-
.../core/FileAppenderResilience_AS_ROOT_Test.java | 2 +-
.../pattern/parser/SamplePatternLayoutTest.java | 2 +-
pom.xml | 19 ++++++------
12 files changed, 71 insertions(+), 58 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list