开发者

Log a java class using log4j called from a Coldfusion application

开发者 https://www.devze.com 2023-03-15 10:10 出处:网络
I want to be able to log debugging messages from my Java classes in a file on my web server, using log4j.I am able to log messages successfully to a file on the server if the Java classes are run from

I want to be able to log debugging messages from my Java classes in a file on my web server, using log4j. I am able to log messages successfully to a file on the server if the Java classes are run from a JUnit test, using the following settings:

log4j.properties:

log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender
log4j.appender.rollingFile.File=D:/logs/fair.log
log4j.appender.rollingFile.MaxFileSize=2MB
log4j.appender.rollingFile.MaxBackupIndex=2
log4j.appender.rollingFile.layout = org.apache.log4j.PatternLayout
log4j.appender.rollingFile.layout.ConversionPattern=%p %t %c - %m%n
log4j.rootLogger = INFO, rollingFile

FairScheduler.java:

private static Logger logger = Logger.getLogg开发者_StackOverflow社区er(FairScheduler.class);
logger.info("initializing Scheduler");

But when I deploy the application to my Coldfusion application, the log messages are no longer logged.

How can I configure my Coldfusion server to log messages to this log file (or view any of my log4j log messages at all)?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号