log4j - log file location on windows
807580Dec 17 2009 — edited Dec 17 2009Hi,
I searched for this issue but couldnt find any thread. hope someone can answer.
i have a client side swing application run as a jar. every user logs in to a terminal windows server and opens the application there. i want the log file for the application to go at, C:\Documents and Settings\xyz\Logs wher xyz is the user logged in.
below is what i have in log4j.properties file,
log4j.rootLogger=Debug, all
log4j.appender.all=org.apache.log4j.RollingFileAppender
log4j.appender.all.File=(System.getProperty ("user.home") + "\\Logs")\\CatUI.log
log4j.appender.all.MaxFileSize=1000KB
log4j.appender.all.MaxBackupIndex=3
log4j.appender.all.layout=org.apache.log4j.PatternLayout
log4j.appender.all.layout.ConversionPattern=%d{MMM dd,yyyy HH:mm:ss.SSS} %6p %c{2} -- %m%n
log4j.appender.all.File=C:\\Logs\\myfile.log works, but i want the log file to be created at C:\Documents and Settings\xyz\Logs
Thanks for looking into this,