Skip to content

Commit

Permalink
adamfisk#133 Removed log4j.xml from jar
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Feb 4, 2014
1 parent 8072164 commit fff6d2f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 48 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/littleshoot/proxy/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.apache.commons.cli.UnrecognizedOptionException;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.xml.DOMConfigurator;
import org.littleshoot.proxy.extras.SelfSignedMitmManager;
import org.littleshoot.proxy.impl.DefaultHttpProxyServer;
import org.littleshoot.proxy.impl.ProxyUtils;
Expand Down Expand Up @@ -125,9 +126,9 @@ private static void printHelp(final Options options,

private static void pollLog4JConfigurationFileIfAvailable() {
File log4jConfigurationFile = new File(
"src/main/resources/log4j.properties");
"src/test/resources/log4j.xml");
if (log4jConfigurationFile.exists()) {
PropertyConfigurator.configureAndWatch(
DOMConfigurator.configureAndWatch(
log4jConfigurationFile.getAbsolutePath(), 15);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/littleshoot/proxy/impl/ProxyUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,16 @@ public static boolean extractBooleanDefaultTrue(final Properties props,
}

public static int extractInt(final Properties props, final String key) {
return extractInt(props, key, -1);
}

public static int extractInt(final Properties props, final String key, int defaultValue) {
final String readThrottleString = props.getProperty(key);
if (StringUtils.isNotBlank(readThrottleString) &&
NumberUtils.isNumber(readThrottleString)) {
return Integer.parseInt(readThrottleString);
}
return -1;
return defaultValue;
}

public static boolean isCONNECT(HttpObject httpObject) {
Expand Down
45 changes: 0 additions & 45 deletions src/main/resources/log4j.xml

This file was deleted.

0 comments on commit fff6d2f

Please sign in to comment.