aspose file tools*
The moose likes Websphere and the fly likes log4j file logging problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "log4j file logging problem" Watch "log4j file logging problem" New topic
Author

log4j file logging problem

Andrei Nistor
Greenhorn

Joined: Aug 31, 2006
Posts: 9
Hello,

I want to specify a path to put my logs.
I use winXPprof, eclipse 3.2, jdk1.6, log4j-1.2.14

The following is the log4j.properties

////////////////////////////////////////

log4j.rootLogger=trace, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %-5p %C{1}.%M - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
#log4j.appender.R.File=.\\logs\\qt.log
log4j.appender.R.File=logs/qt.log
log4j.appender.R.MaxFileSize= 10000KB # Keep one backup file
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p %C{1}.%M - %m%n

/////////////////////////////////////

Problem is i cannot find where it logs my application. I use a swing application.


Live long and prosper!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

"Andrei N.", welcome to JavaRanch.

We're a friendly group here, but we do require members to have valid display names.

Display names include your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names will be deleted.
Hanumanth Kanthi
Ranch Hand

Joined: May 27, 2004
Posts: 74
I see that your appender's "File" is set to "logs/qt.log" so I would guess that it will attempt to write to that file. and the "logs" directory is expect to be under the current working directory at the time when you started you application, or user home directory if you started the app from windows desktop/menu.

Also, if the logs directory does not exist (in either place) then you might get no log file. Try setting that value to c:\\qt.log and see if it gets created.

Cheers,
H. Kanthi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j file logging problem