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

Logback-Classic as Logging-Backend w/ Maven Jetty Plugin

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None

    Description

      http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
      http://logback.qos.ch/faq.html#setup_jetty

      You should add the following or something similar to the FAQ:

      pom.xml:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      ...
      <build>
      ...
      <plugins>
      <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
      ...
      <systemProperties>
      <systemProperty>
      <name>logback.configurationFile</name>
      <value>./src/etc/logback.xml</value>
      </systemProperty>
      </systemProperties>
      </configuration>
      <dependencies>
      <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${lb.version}</version>
      </dependency>
      ...
      </dependencies>
      </plugin>
      </plugins>
      </build>
      <properties>
      <lb.version>0.9.15</lb.version>
      </properties>
      </project>

      If one just adds the dependency on logback-classic the BasicConfigurator will be used for Jetty, resulting in a lot of debug statements.

      The important part is the systemProperty.

      You might want to update the example at http://svn.qos.ch/repos/logback-demo/tags/STABLE also.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            sdavids@gmx.de Sebastian Davids
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: