Redirect output

Hi all, I have a script which call a java program, the logging (to log file) in the program is done using log4j. However, as a safety measure, i still choose to direct standard error to another log file as follow

/usr/bin/java -classpath ${classpath} -Xmx128m TestingProgram 2>> ${LOG_PATH}/${LOG_FILE}

in this log file, i can still see those log messages that i log using log4j (logger.info("HELLO")), why is that? I thought "2>> " would only redirect standard error, isn't it? THANKS!

Should be. However, are you sure you have checked the log4j configuration that the logger at the corresponding level is not attached to multiple appenders, which include the ConsoleAppender in addition to the other destinations configured? If so, your message will be logged to multiple destinations including stderr.