Solved

getting error log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.

Posted on 2010-09-11
3
8,598 Views
Last Modified: 2012-05-10
hello,
I have set up my log4j properties file and i get these errors on the console.
it appears to be writing to the log file, but i would like to get rid of these warnings

log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.


this is the properties file:
----------------------------------------------------------------------------------------------------
log4j.rootCategory=INFO, S

log4j.logger.com.kwm.servlets.smsUserServlet=INFO,A
log4j.logger.com.kwm.servlets.smsPublicServlet=INFO,B
log4j.logger.com.kwm.servlets.signupSmsServlet=INFO,C
log4j.logger.com.kwm.servlets.smsListenerServlet=INFO,D
log4j.logger.com.kwm.servlets.smsAjaxUserServlet=INFO,G

log4j.logger.com.kwm.gateway.GateWayRunner=INFO,E
log4j.logger.com.kwm.utils.test.BurstSmsText=INFO,E
log4j.logger.com.kwm.cron.QueRunner=INFO,F

log4j.appender.S = org.apache.log4j.ConsoleAppender
log4j.appender.S.layout = org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n


log4j.appender.A = org.apache.log4j.RollingFileAppender
log4j.appender.A.MaxFileSize=100MB
log4j.appender.A.MaxBackupIndex=4
log4j.appender.A.File = J:/qrt/tmp/smsUserServlet.log
log4j.appender.A.Append = true
log4j.appender.A.datePattern = '.'yyy-MM-dd
log4j.appender.A.layout = org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.B = org.apache.log4j.RollingFileAppender
log4j.appender.B.MaxFileSize=100MB
log4j.appender.B.MaxBackupIndex=4
log4j.appender.B.File = J:/qrt/tmp/smsPublicServlet.log
log4j.appender.B.Append = true
log4j.appender.B.datePattern = '.'yyy-MM-dd
log4j.appender.B.layout = org.apache.log4j.PatternLayout
log4j.appender.B.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.C = org.apache.log4j.RollingFileAppender
log4j.appender.C.MaxFileSize=100MB
log4j.appender.C.MaxBackupIndex=4
log4j.appender.C.File = J:/qrt/tmp/signupSmsServlet.log
log4j.appender.C.Append = true
log4j.appender.C.datePattern = '.'yyy-MM-dd
log4j.appender.C.layout = org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.D = org.apache.log4j.RollingFileAppender
log4j.appender.D.MaxFileSize=100MB
log4j.appender.D.MaxBackupIndex=4
log4j.appender.D.File = J:/qrt/tmp/smsListenerServlet.log
log4j.appender.D.Append = true
log4j.appender.D.datePattern = '.'yyy-MM-dd
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.E = org.apache.log4j.RollingFileAppender
log4j.appender.E.MaxFileSize=100MB
log4j.appender.E.MaxBackupIndex=4
log4j.appender.E.File = J:/qrt/tmp/GateWayRunner.log
log4j.appender.E.Append = true
log4j.appender.E.datePattern = '.'yyy-MM-dd
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.F = org.apache.log4j.RollingFileAppender
log4j.appender.F.MaxFileSize=100MB
log4j.appender.F.MaxBackupIndex=4
log4j.appender.F.File = J:/qrt/tmp/QueRunner.log
log4j.appender.F.Append = true
log4j.appender.F.datePattern = '.'yyy-MM-dd
log4j.appender.F.layout = org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

log4j.appender.G = org.apache.log4j.RollingFileAppender
log4j.appender.G.MaxFileSize=100MB
log4j.appender.G.MaxBackupIndex=4
log4j.appender.G.File = J:/qrt/tmp/smsAjaxUserServlet.log
log4j.appender.G.Append = true
log4j.appender.G.datePattern = '.'yyy-MM-dd
log4j.appender.G.layout = org.apache.log4j.PatternLayout
log4j.appender.G.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

0
Comment
Question by:paries
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 33655802
> log4j.appender.C.datePattern = '.'yyy-MM-dd

get rid of all the lines setting datePattern
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33655827
is datePattern part of RollingFileAppender or DailyRollingFileAppender ? It might be the latter.

If you do not use it then just comment it out or try using DailyRollingFileAppender
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33655897
log4j.rootCategory=INFO, S,A,B,C,D,E,F
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 106
stackato and cloud 4 85
Way to decrease size of apk file 9 67
Unhandled exception type Exception 18 31
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question