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

Cannot configure Logback autoscan in Wildfly (jboss) 8.1

    XMLWordPrintable

Details

    Description

      When configuring Logback to autoscan (watch) changes in logback.xml config file, it prints that URL pointing to file is not a file - see server.log ("URL [vfs:/content/maven-showcase.war/WEB-INF/classes/logback.xml] is not of type file")

      ReconfigureOnChangeFilter prints "Will scan for changes in [[]] every 1 seconds." It do not see the file, because URL uses vfs: prefix (not file:) as it's Wildfly (jboss) virtual file system.

      I've created this part of code that can convert VFS files (URLs) to real file system path (URLs)):

      final ConfigurationWatchList configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(loggerContext);
      final URL mailURL = configurationWatchList.getMainURL();
      final URLConnection conn = mailURL.openConnection();
      final VirtualFile vf = (VirtualFile) conn.getContent();
      VFSUtils.getPhysicalURL(vf)

      It uses jboss maven dependecy:
      <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-vfs</artifactId>
      <version>3.2.6.Final</version>
      </dependency>

      If I can help anyhow (programming included) let me know.

      Tomas

      Attachments

        Activity

          People

            logback-dev Logback dev list
            sharpus Tomas Jurak
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: