java - How to stop console output for log4j ? Current code will output to file and console both -


in project intend have multiple log files , hence using categories. somehow getting output console well. have tried many options no success. want stop output console. file output should not affected.

here configuration.

#********************common configuration********************** log_path=./logs log_level_common=debug  #********************logging configuration**********************   #configure logging level engine_client log4j.category.engine_client_log=${log_level_common},engine_client log4j.appender.engine_client=org.apache.log4j.fileappender log4j.appender.engine_client.file=${log_path}/engineclient.log log4j.appender.engine_client.layout=org.apache.log4j.patternlayout log4j.appender.engine_client.layout.conversionpattern=%d{dd mmm yyyy hh:mm:ss,sss} %-5p %c{8} [%t] - %m%n 

here java code ...

final static logger logger = logger.getlogger("engine_client"); propertyconfigurator.configure("./config/default.properties"); 

i've copy pasted code on local machine incl. log4j.properties can't seems reproduce issue. it's logging file not console.

just chance, have try set additivity of category inside log4j.properties. this:

 log4j.additivity.engine_client_log=false 

more info here:
http://logging.apache.org/log4j/1.2/manual.html#appenders_and_layouts


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -