-1
我一直在嘗試從簡單的jsf web應用程序登錄到log4j的文本文件,但沒有成功。每次我在位置打開文件時,都沒有寫入文件。我正在部署glassfish。下面是我的log4j.properties配置從jsf網頁應用登錄log4j
log4j.rootLogger = debug, stdout, FILE
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.FILE = org.apache.log4j.RollingFileAppender
log4j.appender.FILE.maxFileSize = 100kb
log4j.appender.FILE.maxBackupIndex = 2
log4j.appender.FILE.File = C:\temp\mylog.txt
log4j.appender.FILE.Threshold = debug
log4j.appender.FILE.layout = org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
我意識到文件mylog.txt獲取.... \域創建\ GlassFish應用server.How我能得到它直接到C的domain1的目錄: \ temp \ mylog.txt