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 Sindhu <cr...@gmail.com> on 2009/05/13 09:17:46 UTC

How to implement DailyRollingFile appender with rollingPolicy

I have implemented DailyRollingFileAppender,but their is no control on the
size of the log file.I would like to control the file size as wel.

Recently i heard about rollingPolicy.when i used the same in my log4j.xml i
got the below warning "ERROR Element type "rollingPolicy" must be declared".

I know the meaning of this error,i.e, rollingPolicy is not found in the
log4j.dtd under the appender tag elemnt.But not knowing how to proceed now. 

The version of log4j.dtd is 1.2 

this is the log4j.xml

<?xml version="1.0" encoding="UTF-8" ?>


  

    
    
    
    
      
    
    
      
    
    
      
    
  


Thanks in advance,
Sindhu
-- 
View this message in context: http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

Re: How to implement DailyRollingFile appender with rollingPolicy

Posted by Yair Ogen <ya...@gmail.com>.
This is already ava

On Wed, May 13, 2009 at 10:17 AM, Sindhu <cr...@gmail.com> wrote:

>
> I have implemented DailyRollingFileAppender,but their is no control on the
> size of the log file.I would like to control the file size as wel.
>
> Recently i heard about rollingPolicy.when i used the same in my log4j.xml i
> got the below warning "ERROR Element type "rollingPolicy" must be
> declared".
>
> I know the meaning of this error,i.e, rollingPolicy is not found in the
> log4j.dtd under the appender tag elemnt.But not knowing how to proceed now.
>
> The version of log4j.dtd is 1.2
>
> this is the log4j.xml
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Thanks in advance,
> Sindhu
> --
> View this message in context:
> http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>

Re: How to implement DailyRollingFile appender with rollingPolicy

Posted by Simon Park <si...@yahoo.co.uk>.
Hi,

Could you send your configuration file to me please?  After a quick test I am unable to reproduce the problem.

In the meantime, try creating
the directory you expect the appender to append to, assuming it doesn't
already exist. Also check whether the user that the
logger is running under has write access to files in that dir.

HTH,

Simon




________________________________
From: Sindhu <cr...@gmail.com>
To: log4j-user@logging.apache.org
Sent: Wednesday, 13 May, 2009 11:08:50
Subject: Re: How to implement DailyRollingFile appender with rollingPolicy


Thanks for the reply,
i tried to implement the same timeAndSizeRollingAppender,but the log file
was not generated instead it is appending logs to netbeans log file :-(( 
.all i changed in the example given was the path where it has to generate 

"c:/logs/log.txt"
what might be the reason.i have downloaded the jar and included the same in
the libraries.


yaog wrote:
> 
> This is already available using: "timeAndSizeRollingAppender".
> You can get it from:
> 
> http://www.simonsite.org.uk/
> 
> 
> 
> On Wed, May 13, 2009 at 10:17 AM, Sindhu <cr...@gmail.com> wrote:
> 
>>
>> I have implemented DailyRollingFileAppender,but their is no control on
>> the
>> size of the log file.I would like to control the file size as wel.
>>
>> Recently i heard about rollingPolicy.when i used the same in my log4j.xml
>> i
>> got the below warning "ERROR Element type "rollingPolicy" must be
>> declared".
>>
>> I know the meaning of this error,i.e, rollingPolicy is not found in the
>> log4j.dtd under the appender tag elemnt.But not knowing how to proceed
>> now.
>>
>> The version of log4j.dtd is 1.2
>>
>> this is the log4j.xml
>>
>> <?xml version="1.0" encoding="UTF-8" ?>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Thanks in advance,
>> Sindhu
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23518983.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


      

Re: How to implement DailyRollingFile appender with rollingPolicy

Posted by Sindhu <cr...@gmail.com>.
Thanks for the reply,
i tried to implement the same timeAndSizeRollingAppender,but the log file
was not generated instead it is appending logs to netbeans log file :-(( 
.all i changed in the example given was the path where it has to generate 

"c:/logs/log.txt"
what might be the reason.i have downloaded the jar and included the same in
the libraries.


yaog wrote:
> 
> This is already available using: "timeAndSizeRollingAppender".
> You can get it from:
> 
> http://www.simonsite.org.uk/
> 
> 
> 
> On Wed, May 13, 2009 at 10:17 AM, Sindhu <cr...@gmail.com> wrote:
> 
>>
>> I have implemented DailyRollingFileAppender,but their is no control on
>> the
>> size of the log file.I would like to control the file size as wel.
>>
>> Recently i heard about rollingPolicy.when i used the same in my log4j.xml
>> i
>> got the below warning "ERROR Element type "rollingPolicy" must be
>> declared".
>>
>> I know the meaning of this error,i.e, rollingPolicy is not found in the
>> log4j.dtd under the appender tag elemnt.But not knowing how to proceed
>> now.
>>
>> The version of log4j.dtd is 1.2
>>
>> this is the log4j.xml
>>
>> <?xml version="1.0" encoding="UTF-8" ?>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Thanks in advance,
>> Sindhu
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23518983.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: How to implement DailyRollingFile appender with rollingPolicy

Posted by Sindhu <cr...@gmail.com>.
 Thanks for the reply,
i tried to immplement the same timeAndSizeRollingAppender,but the log file
was not generated.all i changed in the example given was the path where it
has to generate 

"c:/logs/log.txt"
what might be the reason.i have downloaded the jar and included the same in
the libraries.


yaog wrote:
> 
> This is already available using: "timeAndSizeRollingAppender".
> You can get it from:
> 
> http://www.simonsite.org.uk/
> 
> 
> 
> On Wed, May 13, 2009 at 10:17 AM, Sindhu <cr...@gmail.com> wrote:
> 
>>
>> I have implemented DailyRollingFileAppender,but their is no control on
>> the
>> size of the log file.I would like to control the file size as wel.
>>
>> Recently i heard about rollingPolicy.when i used the same in my log4j.xml
>> i
>> got the below warning "ERROR Element type "rollingPolicy" must be
>> declared".
>>
>> I know the meaning of this error,i.e, rollingPolicy is not found in the
>> log4j.dtd under the appender tag elemnt.But not knowing how to proceed
>> now.
>>
>> The version of log4j.dtd is 1.2
>>
>> this is the log4j.xml
>>
>> <?xml version="1.0" encoding="UTF-8" ?>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Thanks in advance,
>> Sindhu
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23518949.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: How to implement DailyRollingFile appender with rollingPolicy

Posted by Yair Ogen <ya...@gmail.com>.
This is already available using: "timeAndSizeRollingAppender".
You can get it from:

http://www.simonsite.org.uk/



On Wed, May 13, 2009 at 10:17 AM, Sindhu <cr...@gmail.com> wrote:

>
> I have implemented DailyRollingFileAppender,but their is no control on the
> size of the log file.I would like to control the file size as wel.
>
> Recently i heard about rollingPolicy.when i used the same in my log4j.xml i
> got the below warning "ERROR Element type "rollingPolicy" must be
> declared".
>
> I know the meaning of this error,i.e, rollingPolicy is not found in the
> log4j.dtd under the appender tag elemnt.But not knowing how to proceed now.
>
> The version of log4j.dtd is 1.2
>
> this is the log4j.xml
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Thanks in advance,
> Sindhu
> --
> View this message in context:
> http://www.nabble.com/How-to-implement-DailyRollingFile-appender-with-rollingPolicy-tp23516632p23516632.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>