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

add option to FileAppender to auto-create parent directories

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: logback-core
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Bugzilla Id:
      137

      Description

      FileAppender should be able to automatically create parent directories as needed when writing the log file.

      For instance, if configured with <File>/var/tmp/project_name/some_file.log</File>, and the new option set to true (suggest <CreateParentDirectories>true</CreateParentDirectories> maybe), then in FileAppender.setFile(), it should do

      new File( fileName ).getParentFile().mkdirs()

      workaround is to create the directory before initializing logback. Possible but far less than ideal, and rather complicated too

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              bruno.navert Bruno Navert
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: