mirror of https://github.com/apache/nifi.git
NIFI-4708 This closes #2389. Fixes encrypt-config log4j configuration
Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
parent
3157b00a7a
commit
182e2c6e94
|
@ -37,7 +37,7 @@ class EncryptConfigLogger {
|
|||
static configureLogger(boolean verboseEnabled) {
|
||||
|
||||
Properties log4jProps = null
|
||||
URL log4jPropsPath = this.getClass().getResource("log4j.properties")
|
||||
URL log4jPropsPath = EncryptConfigLogger.class.getResource("/log4j.properties")
|
||||
if (log4jPropsPath) {
|
||||
try {
|
||||
log4jPropsPath.withReader { reader ->
|
||||
|
@ -53,6 +53,9 @@ class EncryptConfigLogger {
|
|||
log4jProps = defaultProperties()
|
||||
}
|
||||
|
||||
// For encrypt-config, log output should go to System.err as System.out is used for tool output in decrypt mode
|
||||
log4jProps.put("log4j.appender.console.Target", "System.err")
|
||||
|
||||
if (verboseEnabled) {
|
||||
// Override the log level for this package. For this to work as intended, this class must belong
|
||||
// to the same package (or a parent package) of all the encrypt-config classes
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
log4j.rootLogger=DEBUG,console,test
|
||||
|
||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.console.Target=System.err
|
||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
|
||||
|
||||
|
|
Loading…
Reference in New Issue