my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes log4j level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j level" Watch "log4j level" New topic
Author

log4j level

Ian Shieh
Greenhorn

Joined: Feb 04, 2010
Posts: 7
Here is my setting in the log4j.properties file

*******
log4j.debug=true

log4j.rootLogger=DEBUG, T

log4j.appender.T= org.apache.log4j.DailyRollingFileAppender
...
...
**********

In my java code, I have

************
logger.info("record some information");

..
***********


I don't see any of these log info be in the log file. Is there anything wrong on my setting ?
Ian Shieh
Greenhorn

Joined: Feb 04, 2010
Posts: 7
I think I have gotten it straight. it is working fine. However, I observed on thing and want to confirm here ----

I tested and used

log4j.appender.ForecastBook.DatePattern='.'yyyy-MM-dd-HH-mm

It is supposed to generate a new log file every minute. But actually I found if there is not any new logging event, then it does not generate a new file in the format of "xxx.2010-03-16-xx-xx". Such timestamped file is only generated if there is any new logging event. For example, if there is no event from 12:00 to 12:15 then no log files created. But at 12:16 if a new logging event occurs, then it created a new log file created. Is this correct ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

If you're asking whether it will generate an empty logging file for a minute if no logging events occurred during that minute, the answer is no.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: log4j level
 
Similar Threads
Logging inside Context Listener
generate dynamic log file in apache log4j
Logger question
NX: about Property file, Policy file and Logger file
Struts Log