[logback-dev] svn commit: r880 - in logback/trunk: logback-core/src/main/java/ch/qos/logback/core/db/dialect logback-examples/src/main/java/chapter4/db

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Nov 7 11:44:25 CET 2006


Author: seb
Date: Tue Nov  7 11:44:25 2006
New Revision: 880

Added:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/db/dialect/deleteTables.sql
      - copied unchanged from r879, /logback/trunk/logback-classic/src/test/input/db/deleteTables.sql
   logback/trunk/logback-examples/src/main/java/chapter4/db/
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
   logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml

Log:
moved example configurations to example module
moved deleteTables.sql to appropriate package

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-toMySQL-with-driverManager.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,23 @@
+<configuration>
+
+  <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+     <connectionSource class="ch.qos.logback.classic.db.DriverManagerConnectionSource">
+       <driverClass>"com.mysql.jdbc.Driver</driverClass>
+       <url>jdbc:mysql://host_name:3306/datebase_name</url>
+       <user>logback</user>
+       <password>logback</password>
+     </connectionSource>
+  </appender>
+
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <pattern>%level %thread %logger - %msg%n</pattern>
+    </layout>
+  </appender>
+  <root>
+    <level value="debug"/>
+    <appender-ref ref="STDOUT"/>
+    <appender-ref ref="DB"/>
+  </root>
+</configuration>

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-c3p0.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+	  
+<configuration>
+
+  <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+     <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+       <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
+         <driverClass>${driverClass}</driverClass>
+         <jdbcUrl>${url}</jdbcUrl>
+         <serverName>${serverName}</serverName>
+         <databaseName>${databaseName}</databaseName>
+         <user>${user}</user>
+         <password>${password}</password>
+         <!--
+         <param name="initialConnections" value="10"/>
+         <param name="maxConnections" value="10"/>
+       
+         <param name="max-connections" value="100"/>                                                    
+         <param name="min-connections" value="5" />                                                     
+         <param name="inactivity-timeout" value="200"/>        
+         -->                                         
+       </dataSource>
+       
+       <user>${user}</user>
+       <password>${password}</password>
+     </connectionSource>
+  </appender>
+  
+    
+  <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+  <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+  <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+  
+  
+  <root>
+    <level value ="debug"/>
+    <appender-ref ref="DB" />
+  </root>  
+</configuration>
+
+

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-datasource.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+	  
+<configuration>
+
+  <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+     <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+       
+       <dataSource class="${dataSourceClass}">
+         <param name="${url-key:-url}" value="${url}"/>
+         <serverName>${serverName}</serverName>
+         <databaseName>${databaseName}</databaseName>
+       </dataSource>
+       
+       <user>${user}</user>
+       <password>${password}</password>
+     </connectionSource>
+  </appender>
+  
+  <!-- Prevent internal logback DEBUG messages from polluting the output. -->
+  <logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+  <logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+    
+  <root>
+    <level value ="debug"/>
+    <appender-ref ref="DB" />
+  </root>  
+</configuration>
+
+
+

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-drivermanager.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<configuration>
+
+	<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+		<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
+			<driverClass>${driverClass}</driverClass>
+			<url>${url}</url>
+			<user>${user}</user>
+			<password>${password}</password>
+		</connectionSource>
+	</appender>
+
+	<!-- Prevent internal logback DEBUG messages from polluting the output. -->
+	<logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+	<logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+
+	<root>
+		<level value="debug" />
+		<appender-ref ref="DB" />
+	</root>
+</configuration>
+
+

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-jndi.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+	  
+<configuration>
+  <!-- We create a joran rule that will instance and bind the appropriate
+       data source instance to JNDI. -->   
+  <newRule pattern="configuration/bindDataSourceToJNDI" 
+           actionClass="org.apache.log4j.db.BindDataSourceToJNDIAction"/>
+  	    
+  <bindDataSourceToJNDI />
+  
+  <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+     <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+       
+       <dataSource class="${dataSourceClass}">
+         <param name="${url-key:-url}" value="${url}"/>
+         <serverName>${serverName}</serverName>
+         <databaseName>${databaseName}</databaseName>   
+       </dataSource>
+       
+       <user>${user}</user>
+       <password>${password}</password>>
+     </connectionSource>
+  </appender>
+  
+	<!-- Prevent internal logback DEBUG messages from polluting the output. -->
+	<logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+	<logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+
+  <root>
+    <level value ="debug"/>
+    <appender-ref ref="DB" />
+  </root>  
+  
+</configuration>
+
+

Added: logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/db/append-with-pooled-datasource.xml	Tue Nov  7 11:44:25 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<configuration>
+
+  <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
+     <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
+       
+       <dataSource class="${pooledDataSourceClass}">
+         <param name="${url-key:-url}" value="${url}"/>
+         <serverName>${serverName}</serverName>
+         <databaseName>${databaseName}</databaseName>
+         <user>${user}</user>
+         <password>${password}</password>
+                
+         <initialConnections>10</initialConnections>
+         <maxConnections>10</maxConnections>
+       </dataSource>
+       
+       <user>${user}</user>
+       <password>${password}</password>
+     </connectionSource>
+  </appender>
+
+	<!-- Prevent internal logback DEBUG messages from polluting the output. -->
+	<logger name="ch.qos.logback.core.joran"><level value="INFO" /></logger>
+	<logger name="ch.qos.logback.classic.joran"><level value="INFO" /></logger>
+ 
+  <root>
+    <level value ="debug"/>
+    <appender-ref ref="DB" />
+  </root>  
+</configuration>
+
+



More information about the logback-dev mailing list