|
14 | 14 | */ |
15 | 15 | package org.owasp.esapi.logging.log4j; |
16 | 16 |
|
17 | | -import java.io.IOException; |
18 | | -import java.io.InputStream; |
19 | | -import java.io.OutputStream; |
20 | | -import java.io.PrintStream; |
21 | 17 | import java.util.ArrayList; |
22 | 18 | import java.util.HashMap; |
23 | 19 | import java.util.List; |
24 | 20 | import java.util.Map; |
25 | 21 |
|
26 | | -import org.apache.log4j.LogManager; |
27 | | -import org.apache.log4j.PropertyConfigurator; |
28 | 22 | import org.owasp.esapi.ESAPI; |
29 | 23 | import org.owasp.esapi.LogFactory; |
30 | 24 | import org.owasp.esapi.Logger; |
|
35 | 29 | import org.owasp.esapi.logging.cleaning.CompositeLogScrubber; |
36 | 30 | import org.owasp.esapi.logging.cleaning.LogScrubber; |
37 | 31 | import org.owasp.esapi.logging.cleaning.NewlineLogScrubber; |
38 | | -import org.owasp.esapi.logging.java.JavaLogFactory; |
39 | 32 | import org.owasp.esapi.reference.DefaultSecurityConfiguration; |
40 | 33 | /** |
41 | 34 | * LogFactory implementation which creates Log4J supporting Loggers. |
@@ -74,22 +67,6 @@ public class Log4JLogFactory implements LogFactory { |
74 | 67 | //LEVEL.OFF not used. If it's off why would we try to log it? |
75 | 68 |
|
76 | 69 | LOG_BRIDGE = new Log4JLogBridgeImpl(Log4J_LOG_APPENDER, Log4J_LOG_SCRUBBER, levelLookup); |
77 | | - |
78 | | - try (InputStream stream = Log4JLogFactory.class.getClassLoader(). |
79 | | - getResourceAsStream("log4j.xml")) { |
80 | | - PropertyConfigurator.configure(stream); |
81 | | - } catch (IOException ioe) { |
82 | | - System.err.print(new IOException("Failed to load log4j.xml.", ioe)); |
83 | | - } |
84 | | - |
85 | | - OutputStream nullOutputStream = new OutputStream() { |
86 | | - @Override |
87 | | - public void write(int b) throws IOException { |
88 | | - //No Op |
89 | | - } |
90 | | - }; |
91 | | - |
92 | | - System.setOut(new PrintStream(nullOutputStream)); |
93 | 70 | } |
94 | 71 |
|
95 | 72 | /** |
|
0 commit comments