File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

log4j file logging problem

Andrei Nistor

Joined: Aug 31, 2006
Posts: 9

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.rootLogger=trace, stdout, R

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

log4j.appender.R.MaxFileSize= 10000KB # Keep one backup file
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

Joined: Oct 14, 2005
Posts: 19973

"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.

H. Kanthi
I agree. Here's the link:
subject: log4j file logging problem
jQuery in Action, 3rd edition