Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-769

incorrect variable substitution with nested default value

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.7
    • logback-core
    • None

    Description

      I would like to set the log location for a file appender based on a directory variable, with a fall back to the current directory. In the appender section, I have

      <file>${log.dir:-${user.dir}}/slave.log</file>

      and the jvm is invoked with -Dlog.dir=/mnt/log to set the log location. If I leave out the default value and just use ${log.dir} this works fine, but with the default value the application throws errors while trying to instantiate the appender, indicating that it could not open the file "/mnt/log}/slave.log". The curly bracket should not be there; it seems that this must be due to a bug in the parsing code.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            mneeley Matthew Neeley
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: