Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:29:59+00:00 2026-06-01T05:29:59+00:00

I really like Logback’s support to log into a DB. However, I’m having trouble

  • 0

I really like Logback’s support to log into a DB. However, I’m having trouble using Logback’s variable substitution feature, more specifically, from a property file on the classpath.

My reference: http://logback.qos.ch/manual/configuration.html#variableSubstitution

So I have a multi-module Maven project. In my web module (which generates a .war file), I have my Logback conf files in the following dir:

src/main/resources
- logback.xml
- local.properties
- dev.properties

My logback.xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <property file="${env}.properties"/>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%X{messageId}] %-5level %logger{0} - %msg%n
            </pattern>
        </encoder>
    </appender>

    <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>${logback.db.driverClassName}</driverClass>
                <jdbcUrl>${logback.db.url}</jdbcUrl>
                <user>${logback.db.user}</user>
                <password>${logback.db.password}</password>
            </dataSource>
        </connectionSource>
    </appender>

    <root level="debug">
        <appender-ref ref="DB" />
    </root>
</configuration>

So when I start my Tomcat server, I would pass in the ${env} like this:

-Denv=local

However, I got the following error when I brought up the server:

17:45:22,782  WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0 DriverManagerDataSource:107 - Could not load driverClass logback.db.driverClassName_IS_UNDEFINED
java.lang.ClassNotFoundException: logback.db.driverClassName_IS_UNDEFINED
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)

It looks like Logback Joran was having trouble locating the property file.

Can anyone let me know what I did wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:30:00+00:00Added an answer on June 1, 2026 at 5:30 am

    As I said in the comments:

    Should be:

    <property resource="${env}.properties"/>
    

    Not

    <property file="${env}.properties"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really like the feature of having a dependency diagram and preventing certain assemblies
I really like the Rails authorization gem CanCan . However, I find myself having
I really like the promote to home page feature of drupal. But what if
I really like how I can easily share files on a network using the
I really like the way MonoDevelop's automcomplete / intellisense feature works. Specifically I like
I really like py.test , but I am having lots of difficulty understanding how
I really like using the _countof() macro in VS and I'm wondering if there
I really like the feature of SQLAlchemy that allows you to see if an
I really like this jQuery Gallery However, instead of numbers for navigation, I'd like
I really like the ability to edit javascript in the chrome debugger however, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.