You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by PRAVIN VAJIRKAR <pr...@adtran.com> on 2002/07/24 16:04:06 UTC
log4j question
Hi there,
I don't know if this a right place to mail for log4j questions. I would really appreciate if you guys can help me out in this.
I am new to log4j and trying to put the INFO/DEBUG....messages to a log file. Now, when I print the same in the console, it shows date, time and bunch of other things (which is good), but when I try with teh log file, it jus shows the text message without the date and time. Is something wrong with
my properties file/XML file??
Any ideas??
Pravin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: log4j question
Posted by Colin MacDonald <co...@templarcorp.com>.
> -----Original Message-----
>
> I am new to log4j and trying to put the INFO/DEBUG....messages to
> a log file. Now, when I print the same in the console, it shows
> date, time and bunch of other things (which is good), but when I
> try with teh log file, it jus shows the text message without the
> date and time. Is something wrong with
> my properties file/XML file??
Well, without seeing your properties file, I can only guess, but I suspect
that you need to add something like the following lines:
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{MMM dd yyyy HH:mm:ss} %5p
(%C.%M:%L) - %m%n
Hope that helps. If not, send your properties file.
-----------------------------------------------------------------
Colin MacDonald | Software Developer | Templar Corporation |
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>