log4j.properties not updating [message #1847489] |
Thu, 28 October 2021 16:28  |
Eclipse User |
|
|
|
I have a simple maven project which uses log4j.properites. The Properties file is in sources/resources.
My java file
========================
package man1;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
package man1;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class BlankOwl {
static final Logger logger = LogManager.getLogger(BlankOwl.class);
public static void main(String[] args) {
logger.debug("using logger debug");
logger.info("using logger info");
logger.warn("using logger warn");
logger.error("using logger error");
logger.fatal("using logger fatal");
}
}
my properties file
# initialize root logger with level debug for stdout and fout
log4j.rootLogger=fatal,consol,fout
# set the log level for these components
#log4j.logger.com.endeca=INFO
#log4j.logger.com.endeca.itl.web.metrics=INFO
# add a ConsoleAppender to the logger stdout to write to the console
log4j.appender.consol=org.apache.log4j.ConsoleAppender
log4j.appender.consol.layout=org.apache.log4j.PatternLayout
# use a simple message format
log4j.appender.stdout.layout.ConversionPattern=%m%n
# add a FileAppender to the logger file
log4j.appender.fout=org.apache.log4j.FileAppender
# create a log file
log4j.appender.fout.File=C:/Users/flinn/logs/man3.txt
log4j.appender.fout.layout=org.apache.log4j.PatternLayout
# use a more detailed message pattern
log4j.appender.fout.layout.ConversionPattern=%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n
I can change the root property from debug to fatal in the properties file and the program only outputs error and fatal, no matter what changes are made to the root level. It also does not write the file. I've read & tried all the online suggestions I could find to no avail. I'm in the process of tearing out what hair I have left. Any help is appreciated; With the code, not the hair{-:
Don
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05114 seconds