0
我想根據類進行日誌記錄。我創造了這樣的事情:Log4j基於類的日誌記錄
log4j.appender.cancellation=org.apache.log4j.RollingFileAppender
log4j.appender.cancellation.MaxFileSize=10MB
log4j.appender.cancellation.Threshold=INFO
log4j.appender.cancellation.File=/logs/cancellation.log
log4j.appender.cancellation.layout=org.apache.log4j.PatternLayout
log4j.appender.cancellation.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
log4j.logger.com.mydomain.bean.CancellationBean=cancellation
,並在我的課:
private Logger logger = Logger.getLogger("com.mydomain.bean.CancellationBean");
,但它不工作,什麼建議嗎?