Regards
Shalindra Singh
SCJP, SCWCD
shalindra Singh Suryvanshee wrote:you may write like below -
RollingFileAppender appender =
new RollingFileAppender(new PatternLayout("%-4r [%t] %-5p %c %x - %m%n")
, getServletContext().getRealPath("/logs/error.log"), true);
your logs directory would be parallel to WEB-INF.
Try out this.
Thanks
Shalindra Singh
al yosha wrote:Do you mean create the log directory one level up from where it is at the moment? Why would this make a difference?
Regards
Shalindra Singh
SCJP, SCWCD
Paul Clapham wrote:
al yosha wrote:Do you mean create the log directory one level up from where it is at the moment? Why would this make a difference?
I don't think it would make a difference either.
But what have you established so far? You said that your log file was "empty". That implies to me that something created the log file, or you would have said it doesn't exist. Did you do that, or did log4j do it? (Or does it in fact not exist?)
al yosha wrote:No, the books says to make sure the file already exists before hand...
Regards
Shalindra Singh
SCJP, SCWCD
logger.setLevel(Level.DEBUG);
//logger.addAppender(appender);
logger.info("Starting " + logger.getName());
Regards
Shalindra Singh
SCJP, SCWCD
Why fit in when you were born to stand out? - Seuss. Tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|