switched to slf4j for virtualbox

This commit is contained in:
Adrian Cole 2012-01-07 16:19:36 -08:00
parent c18696e91c
commit b049e93401
3 changed files with 63 additions and 21 deletions

View File

@ -68,7 +68,6 @@
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId> <artifactId>jetty-server</artifactId>
<version>7.4.0.RC0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -103,12 +102,6 @@
<version>0.9.29</version> <version>0.9.29</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<profiles> <profiles>

View File

@ -34,7 +34,7 @@ import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.config.ValueOfConfigurationKeyOrNull; import org.jclouds.config.ValueOfConfigurationKeyOrNull;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
import org.jclouds.sshj.config.SshjSshClientModule; import org.jclouds.sshj.config.SshjSshClientModule;
import org.jclouds.virtualbox.config.VirtualBoxConstants; import org.jclouds.virtualbox.config.VirtualBoxConstants;
import org.jclouds.virtualbox.domain.VmSpec; import org.jclouds.virtualbox.domain.VmSpec;
@ -102,7 +102,7 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest {
URI.create("file://" + System.getProperty("user.home") + "/.ssh/id_rsa")).build())); URI.create("file://" + System.getProperty("user.home") + "/.ssh/id_rsa")).build()));
context = new ComputeServiceContextFactory().createContext(provider, identity, credential, ImmutableSet context = new ComputeServiceContextFactory().createContext(provider, identity, credential, ImmutableSet
.<Module> of(new Log4JLoggingModule(), new SshjSshClientModule(), hostModule), overrides); .<Module> of(new SLF4JLoggingModule(), new SshjSshClientModule(), hostModule), overrides);
Function<String, String> configProperties = context.utils().injector().getInstance( Function<String, String> configProperties = context.utils().injector().getInstance(
ValueOfConfigurationKeyOrNull.class); ValueOfConfigurationKeyOrNull.class);
imageId = configProperties.apply(ComputeServiceConstants.PROPERTY_IMAGE_ID); imageId = configProperties.apply(ComputeServiceConstants.PROPERTY_IMAGE_ID);

View File

@ -1,15 +1,64 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration scan="false"> <configuration scan="false">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="FILE" class="ch.qos.logback.core.FileAppender">
<encoder> <file>target/test-data/jclouds.log</file>
<pattern>%d{HH:mm:ss.SSS} - %msg%n</pattern>
</encoder> <layout class="ch.qos.logback.classic.PatternLayout">
</appender> <Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
<!-- turn OFF all logging (children can override) --> </layout>
<root level="OFF"> </appender>
<appender-ref ref="STDOUT"/>
</root> <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
<logger name="jclouds.compute" level="debug"/> <file>target/test-data/jclouds-wire.log</file>
<logger name="jclouds.headers" level="debug"/>
<logger name="jclouds.ssh" level="debug"/> <layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
</layout>
</appender>
<appender name="COMPUTEFILE" class="ch.qos.logback.core.FileAppender">
<file>target/test-data/jclouds-compute.log</file>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
</layout>
</appender>
<appender name="SSHFILE" class="ch.qos.logback.core.FileAppender">
<file>target/test-data/jclouds-ssh.log</file>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
</layout>
</appender>
<root>
<level value="warn" />
</root>
<category name="org.jclouds">
<priority value="DEBUG" />
<appender-ref ref="FILE" />
</category>
<category name="jclouds.wire">
<priority value="DEBUG" />
<appender-ref ref="WIREFILE" />
</category>
<category name="jclouds.headers">
<priority value="DEBUG" />
<appender-ref ref="WIREFILE" />
</category>
<category name="jclouds.compute">
<priority value="DEBUG" />
<appender-ref ref="COMPUTEFILE" />
</category>
<category name="jclouds.ssh">
<priority value="DEBUG" />
<appender-ref ref="SSHFILE" />
</category>
</configuration> </configuration>