Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

log4j - log file location on windows

807580Dec 17 2009 — edited Dec 17 2009
Hi,
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,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2010
Added on Dec 17 2009
2 comments
16,381 views