this commit removes log4j in favour of logback; logback also uses slf4j api
so it's pretty much a drop-in replacement, but with some big advantages:
- common settings can be <include>d from files, esp those in
core/src/main/resources/brooklyn/
- logging for tests is automatic (using
test-support/src/main/resources/logback-tests.xml)
- your own logback.xml can just be one line -- see e.g.
usage/launcher/src/main/resources/logback.xml
- if you don't have a logback, default is lots of logging, not none or
errors
you can set a specific logback config file to use with:
-Dlogback.configurationFile=/path/to/config.xml
in eclipse you may have to update the maven project. and if you're not
getting the logging you expect in the IDE,
make sure src/main/resources is included (in eclipse, right-click the
project, the Build Path -> Configure,
then make sure all dirs are included (All) and excluded (None) -- mvn clean
install should do this for you btw);
FYI you might find that the IDE logs to a file brooklyn-tests.log because
it doesn't distinguish between test builds.
see http://logback.qos.ch/manual/configuration.html for more information
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/b05fb49b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/b05fb49b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/b05fb49b
Branch: refs/heads/0.5.0
Commit: b05fb49b726e8b9acc9432c3a57740eb21273e58
Parents: e0e98a3
Author: Alex Heneveld <[email protected]>
Authored: Wed Aug 15 21:58:06 2012 +0100
Committer: Alex Heneveld <[email protected]>
Committed: Tue Dec 4 17:39:01 2012 -0600
----------------------------------------------------------------------
usage/jsgui/pom.xml | 18 -------
usage/jsgui/src/test/resources/log4j.properties | 49 --------------------
usage/jsgui/src/test/resources/logback-test.xml | 11 -----
3 files changed, 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/b05fb49b/usage/jsgui/pom.xml
----------------------------------------------------------------------
diff --git a/usage/jsgui/pom.xml b/usage/jsgui/pom.xml
index 140bba7..bb0a39d 100644
--- a/usage/jsgui/pom.xml
+++ b/usage/jsgui/pom.xml
@@ -21,18 +21,6 @@
<dependencies>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>io.brooklyn</groupId>
<artifactId>brooklyn-rest</artifactId>
<version>${project.version}</version>
@@ -49,12 +37,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>brooklyn-test-support</artifactId>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>io.brooklyn</groupId>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/b05fb49b/usage/jsgui/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/test/resources/log4j.properties
b/usage/jsgui/src/test/resources/log4j.properties
deleted file mode 100644
index ec2e823..0000000
--- a/usage/jsgui/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-# two outputs by default, stdout and ./brooklyn.log
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p %m%n
-log4j.appender.stdout.Threshold=INFO
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.File=brooklyn.log
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d %5p %c: %m%n
-log4j.appender.R.MaxFileSize=100MB
-log4j.appender.R.MaxBackupIndex=10
-
-# default level is info
-log4j.rootLogger=INFO, stdout, R
-
-#these external items can be noisy and uninteresting
-log4j.logger.org.hibernate.SQL = WARN
-log4j.logger.org.hibernate.type = WARN
-log4j.logger.org.hibernate.tool.hbm2ddl = WARN
-log4j.logger.org.eclipse.jetty = WARN
-
-# schmizz (sshj) is especially bad, screaming about "errors" that are normal;
-# would be nice to downgrade but difficult, but at least don't write to console
-log4j.logger.net.schmizz=INFO, R
-log4j.additivity.net.schmizz=false
-# similarly ComputeCache is noisy with its info output, write to file only
-log4j.logger.org.apache.whirr.service.ComputeCache=DEBUG, R
-log4j.additivity.org.apache.whirr.service.ComputeCache=false
-
-# these categories may be interesting
-log4j.logger.brooklyn=DEBUG
-
-# ssh i/o for entities is very useful
-log4j.logger.brooklyn.SSH=DEBUG
-
-# for some low-level activity, including jclouds+whirr, detail can be useful
-# especially if something goes wrong (or you get bored); but jclouds can be
chatty so only to file
-log4j.logger.jclouds=DEBUG, R
-log4j.additivity.jclouds=false
-log4j.logger.org.jclouds=DEBUG, R
-log4j.additivity.org.jclouds=false
-log4j.logger.org.apache.whirr=DEBUG
-log4j.logger.brooklyn.location.basic.jclouds=DEBUG
-log4j.logger.brooklyn.util.internal.ssh=DEBUG
-# reenable this one because grails can clobber debug logging, above
-log4j.logger.brooklyn.entity=DEBUG
-
-log4j.logger.com.sun.jersey.spi.inject.Errors=DEBUG
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/b05fb49b/usage/jsgui/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/test/resources/logback-test.xml
b/usage/jsgui/src/test/resources/logback-test.xml
deleted file mode 100644
index 75f192b..0000000
--- a/usage/jsgui/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<configuration>
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <outputPatternAsHeader>false</outputPatternAsHeader>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <root level="debug">
- <appender-ref ref="STDOUT"/>
- </root>
-</configuration>