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

variable usage in fileNamePattern causing problems

    XMLWordPrintable

Details

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

    Description

      Dear Logback team,

      I am trying to optimize logback.xml file in our environment. Logging directory location we are specifying in more than one location so I am trying to create a variable ( property ) to hold log directory and reuse. Now problem is if path is “D:\seeta\log” then logback is stripping out all back ward slashes and giving it as “D:seetalog”. I know if I use forward slash or double slash it works fine but I cannot control the user who use my tool. Can you please help us in fixing it?

      Working scenario
      =============
      <configuration>

      <fileNamePattern> d:\seeta\log\cd_core.%d

      {yyyy-MM-dd}.log</fileNamePattern>

      </configuration>

      NON-Working Scenario
      ==============
      <configuration>

      <property name="log.dir" value="d:\seeta\log"/>

      <fileNamePattern>${log.dir}\cd_core.%d{yyyy-MM-dd}

      .log</fileNamePattern>

      </configuration>

      NOTE : I have attached logback.jar and configuration files. Here logback_working.xml is existing configuration and trying to modify to {{ logback_NOT_working.xml}}

      Regards,
      Seeta Vadali

      Attachments

        1. logback_NOT_working.xml
          2 kB
          Seeta Vadali
        2. logback_working.xml
          2 kB
          Seeta Vadali

        Activity

          People

            logback-dev Logback dev list
            svadali Seeta Vadali
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: