Solved

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

Posted on 2010-09-11
3
9,021 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb mdb examples 1 21
maven not picking latest jar instead picking old jar from .m2 12 49
DTD and JAVA versions 1 32
Html split(text) 2 32
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

733 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