HI,
Thanks for your timely help, Mr. Stauffer.
James, the problem was with the SimpleDateFormat. If you look at the
fileName i have specified, its "logs/debug.log". But in the file which you
gave me, it accepts a SimpleDateFormat, i.e, "yyyy-MM-dd" or "yyyy/MM/dd",
or some similar format. So all i had to do was to change the fileName, i
changed it to "yyyy-MM-dd" and it worked fine.
And regarding the backlashes, i have no control over it, because everytime i
remove it, my java program adds it, the backlash acts as an escape sequence
here. So when i read the property file and try changing the value then my
program modifies the entire property file itself, thus the presence of
backlash.
Thanks & Regards,
Kailash.K.N.
----- Original Message -----
From: "James Stauffer" <[EMAIL PROTECTED]>
To: "Log4J Users List" <[email protected]>
Sent: Tuesday, June 20, 2006 7:17 PM
Subject: Re: Setting my own appender creating error
log4j.appender.R.layout.ConversionPattern=%d{dd-MMM-yyyy HH\:mm\:ss}
%6p - %m %n
I think it is having problems with that line. Try removing the
backslashes.
On 6/20/06, Kailash KN <[EMAIL PROTECTED]> wrote:
Hi,
I'm using an external appender(user-defined), but when i give the entire
package namein the property file, I have created the jar and set it in
the
classpath also. But then, it does'nt work. It gives me the following
error....
log4j: Parsing for [root] with value=[DEBUG, R].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "R".
log4j: Parsing layout options for "R".
log4j: Setting property [conversionPattern] to [%d{dd-MMM-yyyy HH:mm:ss}
%6p - %m %n].
log4j: End of parsing for "R".
log4j: Setting property [file] to [logs/debug.log].
Exception in thread "main"
java.lang.IllegalArgumentException: Illegal pattern
character 'l'
at
java.text.SimpleDateFormat.compile(SimpleDateFormat.java:675)
at
java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:494)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:443)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:424)
at
sps.log.log4j.DateFormatFileAppender.setFile(DateFormatFileAppender.java:78)
at
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:316)
at
org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:324)
at RollType.main(RollType.java:7)
Here is my property file,
log4j.debug=true
log4j.rootLogger=DEBUG, R
log4j.logger.debugLogger=R
log4j.appender.R=sps.log.log4j.DateFormatFileAppender
log4j.appender.R.File=logs/debug.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{dd-MMM-yyyy
HH\:mm\:ss} %6p - %m %n
James, this is your program.
Thanks & Regards,
Kailash.K.N.
******* DISCLAIMER: This email and any files transmitted with it are
privileged and confidential information and intended solely for the use
of
the individual or entity to which they are addressed. If you are not the
intended recipient, please notify the sender by e-mail and delete the
original message. Further, you are not to copy, disclose, or distribute
this
e-mail or its contents to any other person and any such actions are
unlawful. This e-mail may contain viruses. Torry Harris Business
Solutions
has taken every reasonable precaution to minimize this risk, but is not
liable for any damage you may sustain as a result of any virus in this
e-mail. The recipient should check this email and any attachments for
the
presence of viruses. THBS reserves the right to monitor and review the
content of all messages sent to or from this e-mail address********
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
******* DISCLAIMER: This email and any files transmitted with it are privileged
and confidential information and intended solely for the use of the individual
or entity to which they are addressed. If you are not the intended recipient,
please notify the sender by e-mail and delete the original message. Further,
you are not to copy, disclose, or distribute this e-mail or its contents to any
other person and any such actions are unlawful. This e-mail may contain
viruses. Torry Harris Business Solutions has taken every reasonable precaution
to minimize this risk, but is not liable for any damage you may sustain as a
result of any virus in this e-mail. The recipient should check this email and
any attachments for the presence of viruses. THBS reserves the right to monitor
and review the content of all messages sent to or from this e-mail
address********
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]