re ading variables from jdbc.properties file

Hi! I have the following appender: <connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource"> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user> <password>${connection.username}</password> </dataSource> </connectionSource> I also have the following: <property resource="jdbc.properties" /> The file is located under src - classpath and includes the variables However, I get error messages when I try to start tomcat unless I change the variables to static text. I also tried <property file="src/jdbc.properties /> but with no success What is wrong? -- View this message in context: http://old.nabble.com/reading-variables-from-jdbc.properties-file-tp32788737... Sent from the Logback User mailing list archive at Nabble.com.

Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource"> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user> <password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?

Sure! On Mon, Nov 7, 2011 at 7:59 PM, ceki <ceki@qos.ch> wrote:
Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki
On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource"> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user> <password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- what matters most is how you see yourself

Have you tried adding an "on console listener"? <configuration> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> ... the rest of the configuration file </configuration> See also [1]. [1] http://logback.qos.ch/manual/configuration.html#statusListener On 07.11.2011 19:03, Odelya Holiday wrote:
Sure!
On Mon, Nov 7, 2011 at 7:59 PM, ceki<ceki@qos.ch> wrote:
Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki
On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource"> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user> <password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?
-- Ceki http://twitter.com/#!/ceki

Yes!! it helped! Just to understand - what is the usage of this class? (The name of the classes does not sound trivial for adding variables..) On Mon, Nov 7, 2011 at 8:06 PM, ceki <ceki@qos.ch> wrote:
Have you tried adding an "on console listener"?
<configuration> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> ... the rest of the configuration file </configuration>
See also [1].
[1] http://logback.qos.ch/manual/configuration.html#statusListener
On 07.11.2011 19:03, Odelya Holiday wrote:
Sure!
On Mon, Nov 7, 2011 at 7:59 PM, ceki<ceki@qos.ch> wrote:
Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki
On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
<driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user>
<password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- what matters most is how you see yourself

Adding the OnConsoleStatusListener prints logback internal messages on the console. It does *not* add any properties. The idea was to help you discover errors in your configuration file. On 07.11.2011 19:16, Odelya Holiday wrote:
Yes!!
it helped!
Just to understand - what is the usage of this class? (The name of the classes does not sound trivial for adding variables..)
On Mon, Nov 7, 2011 at 8:06 PM, ceki<ceki@qos.ch> wrote:
Have you tried adding an "on console listener"?
<configuration> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> ... the rest of the configuration file </configuration>
See also [1].
[1] http://logback.qos.ch/manual/configuration.html#statusListener
On 07.11.2011 19:03, Odelya Holiday wrote:
Sure!
On Mon, Nov 7, 2011 at 7:59 PM, ceki<ceki@qos.ch> wrote:
Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki
On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
<driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user>
<password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- Ceki http://twitter.com/#!/ceki

you are right - I removed it - and the variables are working again. Maybe it was Tomcat caching issues. Thanks for trying to help and I love logback! On Mon, Nov 7, 2011 at 8:24 PM, ceki <ceki@qos.ch> wrote:
Adding the OnConsoleStatusListener prints logback internal messages on the console. It does *not* add any properties. The idea was to help you discover errors in your configuration file.
On 07.11.2011 19:16, Odelya Holiday wrote:
Yes!!
it helped!
Just to understand - what is the usage of this class? (The name of the classes does not sound trivial for adding variables..)
On Mon, Nov 7, 2011 at 8:06 PM, ceki<ceki@qos.ch> wrote:
Have you tried adding an "on console listener"?
<configuration> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> ... the rest of the configuration file </configuration>
See also [1].
[1] http://logback.qos.ch/manual/configuration.html#statusListener
On 07.11.2011 19:03, Odelya Holiday wrote:
Sure!
On Mon, Nov 7, 2011 at 7:59 PM, ceki<ceki@qos.ch> wrote:
Are properties defined before the appender? -- Ceki http://twitter.com/#!/ceki
On 07.11.2011 18:55, Jordan Blay wrote:
Hi!
I have the following appender:
<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource"> <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
<driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>${connection.url}</jdbcUrl> <user>${connection.username}</user>
<password>${connection.username}</password> </dataSource> </connectionSource>
I also have the following:
<property resource="jdbc.properties" />
The file is located under src - classpath and includes the variables
However, I get error messages when I try to start tomcat unless I change the variables to static text.
I also tried
<property file="src/jdbc.properties /> but with no success
What is wrong?
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- what matters most is how you see yourself
participants (3)
-
ceki
-
Jordan Blay
-
Odelya Holiday