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

Logback is not reading a system property variable

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Major Major
    • None
    • 1.1.2
    • logback-core
    • None
    • Ubuntu Desktop 14.04, Scala 2.10, sl4j 1.7.6, groovy 2.2.1, sbt 0.13

    Description

      I have used the sample logback.groovy from the documentation for using a variable. Defining it within the log config file works fine but if I try to set it as a system property it does not find it. I have attached three files: build.sbt, logback.groovy, Test.scala. My test program confirms that the system property has been set correctly. When I run the command:

      sbt -DUSER_HOME="/tmp"

      I get the following output:

      22:03:30,768 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.groovy] at file:/home/des/workspace/play/target/scala-2.10/classes/logback.groovy
      22:03:31,449 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@5c3286d0 - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
      22:03:31,450 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@5c3286d0 - Naming appender as [FILE] 22:03:31,515 |-ERROR in ch.qos.logback.classic.gaffer.AppenderDelegate@7930f0f9 - Appender [FILE] of type [ch.qos.logback.core.FileAppender] has no appplicable [USER_HOME] property
      22:03:31,556 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [null/myApp.log] 22:03:31,562 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@5c3286d0 - Setting level of logger [ROOT] to DEBUG
      22:03:31,569 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@5c3286d0 - Attaching appender named [FILE] to Logger[ROOT]

      Attachments

        1. build.sbt
          0.2 kB
        2. logback.groovy
          0.3 kB
        3. Test.scala
          0.2 kB

        Activity

          People

            logback-dev Logback dev list
            hughgearse Des Magner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: