changeset 485:2fd1eb419a15

command line '-l default' enables internal XML config
author Devel 1
date Wed, 09 Aug 2017 10:55:59 +0200
parents 22e47569bc32
children b1e63257aefa
files stress-tester/src/main/java/com/passus/st/Main.java stress-tester/src/main/resources/log4j2.xml
diffstat 2 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/Main.java	Wed Aug 09 10:35:20 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/Main.java	Wed Aug 09 10:55:59 2017 +0200
@@ -185,10 +185,10 @@
             String logLevel = "error";
             if (cl.hasOption("l")) {
                 logLevel = cl.getOptionValue("l");
-
             }
-
-            Log4jConfigurationFactory.enableFactory(logLevel);
+            if (!logLevel.equals("default")) {
+                Log4jConfigurationFactory.enableFactory(logLevel);
+            }
 
             SessionMapper mapper;
             if (cl.hasOption("mr")) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/resources/log4j2.xml	Wed Aug 09 10:55:59 2017 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="WARN">
+  <Appenders>
+	<Console name="Console" target="SYSTEM_OUT">
+	  <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{2} - %msg%n"/>
+	</Console>
+  </Appenders>
+  <Loggers>
+	<Logger name="com.passus.st.client.http.HttpSynchClientWorker" level="debug" additivity="false">
+	  <AppenderRef ref="Console"/>
+	</Logger>
+	<Logger name="com.passus.st.client.http.HttpFlowBasedClientWorker" level="debug" additivity="false">
+	  <AppenderRef ref="Console"/>
+	</Logger>
+	<Root level="error">
+	  <AppenderRef ref="Console"/>
+	</Root>
+  </Loggers>
+</Configuration>
\ No newline at end of file