It allows the developer to control which log statements are output with arbitrary granularity
ex:
log4j.logger.idv.ben.MyTestClass=DEBUG, stdout, F
定義"idv.ben.MyTestClass",
輸出到stdout和F,
static Logger logger = Logger.getLogger("idv.ben.MyTestClass");
取得定義的logger
logger.debug("Hello Log4j");
印出Hello Log4j
沒有留言:
張貼留言