详细参考: http://logging.apache.org/log4j/2.x/manual/appenders.html 但发现当把配置文件修改为输出为file时,原本用在console上%符号都不work了。 改天再来学习这块儿