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 vincentw <vi...@yahoo.com> on 2006/11/01 22:45:02 UTC

RollingFileAppender Not rolling over

Hi, I'm having trouble with thr RFA not rollingover.  Here is my config

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">

  <!-- ==========Appenders========== -->
  <!-- Define asyncAppender -->
  <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="R"/>
  </appender>  <!-- Define R; Rolling file logger -->
  <appender name="R" class="org.apache.log4j.RollingFileAppender">
      <param name="File" value="logs/adminlog.txt"/>
      <param name="MaxFileSize" value="4KB"/>
      <param name="MaxBackupIndex" value="3"/>
      <layout class="xxxx.aLayout">
      </layout>
  </appender>

		
  <!-- ==========Setup the Root category========== -->
  <!-- rules for logging DEBUG<INFO<WARN<ERROR<FATAL. -->
  <root>
  	<priority value = "info"/>
    <appender-ref ref="ASYNC"/>
  </root>
</log4j:configuration>

I'm running into this problem after I have extended the Layout class.  I
extended the layout class so I can have header info in each of the log
files.  If I used 
<layout class="org.apache.log4j.PatternLayout">
  <param name="ConversionPattern"
    value="%d{yyyy-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/>

instead I have no rollover problems.

Now what I see is I just get one file of 4KB rolling over onto itself, but I
get the header info.

Any ideas??

Thanks in advance
-- 
View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7123228
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: RollingFileAppender Not rolling over

Posted by vincentw <vi...@yahoo.com>.
Does the header print out depend on logging level??  What I'm seeing is if I
set the level to anything but debug the header info will not be displayed. 
Anyone come across this or have any ideas?

Thanks


vincentw wrote:
> 
> Hi, I'm having trouble with thr RFA not rollingover.  Here is my config
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> 
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> debug="false">
> 
>   <!-- ==========Appenders========== -->
>   <!-- Define asyncAppender -->
>   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>         <appender-ref ref="STDOUT"/>
>         <appender-ref ref="R"/>
>   </appender>  <!-- Define R; Rolling file logger -->
>   <appender name="R" class="org.apache.log4j.RollingFileAppender">
>       <param name="File" value="logs/adminlog.txt"/>
>       <param name="MaxFileSize" value="4KB"/>
>       <param name="MaxBackupIndex" value="3"/>
>       <layout class="xxxx.aLayout">
>       </layout>
>   </appender>
> 
> 		
>   <!-- ==========Setup the Root category========== -->
>   <!-- rules for logging DEBUG<INFO<WARN<ERROR<FATAL. -->
>   <root>
>   	<priority value = "info"/>
>     <appender-ref ref="ASYNC"/>
>   </root>
> </log4j:configuration>
> 
> I'm running into this problem after I have extended the Layout class.  I
> extended the layout class so I can have header info in each of the log
> files.  If I used 
> <layout class="org.apache.log4j.PatternLayout">
>   <param name="ConversionPattern"
>     value="%d{yyyy-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/>
> 
> instead I have no rollover problems.
> 
> Now what I see is I just get one file of 4KB rolling over onto itself, but
> I get the header info.
> 
> Any ideas??
> 
> Thanks in advance
> 

-- 
View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7203739
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: RollingFileAppender Not rolling over

Posted by vincentw <vi...@yahoo.com>.
Yes it does work when using standard layout class.


James Stauffer wrote:
> 
> Does it work if you use the standard layout class?
> 
> On 11/1/06, vincentw <vi...@yahoo.com> wrote:
>>
>> Hi, I'm having trouble with thr RFA not rollingover.  Here is my config
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>>
>> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
>> debug="false">
>>
>>   <!-- ==========Appenders========== -->
>>   <!-- Define asyncAppender -->
>>   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>>         <appender-ref ref="STDOUT"/>
>>         <appender-ref ref="R"/>
>>   </appender>  <!-- Define R; Rolling file logger -->
>>   <appender name="R" class="org.apache.log4j.RollingFileAppender">
>>       <param name="File" value="logs/adminlog.txt"/>
>>       <param name="MaxFileSize" value="4KB"/>
>>       <param name="MaxBackupIndex" value="3"/>
>>       <layout class="xxxx.aLayout">
>>       </layout>
>>   </appender>
>>
>>
>>   <!-- ==========Setup the Root category========== -->
>>   <!-- rules for logging DEBUG<INFO<WARN<ERROR<FATAL. -->
>>   <root>
>>         <priority value = "info"/>
>>     <appender-ref ref="ASYNC"/>
>>   </root>
>> </log4j:configuration>
>>
>> I'm running into this problem after I have extended the Layout class.  I
>> extended the layout class so I can have header info in each of the log
>> files.  If I used
>> <layout class="org.apache.log4j.PatternLayout">
>>   <param name="ConversionPattern"
>>     value="%d{yyyy-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/>
>>
>> instead I have no rollover problems.
>>
>> Now what I see is I just get one file of 4KB rolling over onto itself,
>> but I
>> get the header info.
>>
>> Any ideas??
>>
>> Thanks in advance
>> --
>> View this message in context:
>> http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7123228
>> 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
>>
>>
> 
> 
> -- 
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7141878
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: RollingFileAppender Not rolling over

Posted by James Stauffer <st...@gmail.com>.
Does it work if you use the standard layout class?

On 11/1/06, vincentw <vi...@yahoo.com> wrote:
>
> Hi, I'm having trouble with thr RFA not rollingover.  Here is my config
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> debug="false">
>
>   <!-- ==========Appenders========== -->
>   <!-- Define asyncAppender -->
>   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>         <appender-ref ref="STDOUT"/>
>         <appender-ref ref="R"/>
>   </appender>  <!-- Define R; Rolling file logger -->
>   <appender name="R" class="org.apache.log4j.RollingFileAppender">
>       <param name="File" value="logs/adminlog.txt"/>
>       <param name="MaxFileSize" value="4KB"/>
>       <param name="MaxBackupIndex" value="3"/>
>       <layout class="xxxx.aLayout">
>       </layout>
>   </appender>
>
>
>   <!-- ==========Setup the Root category========== -->
>   <!-- rules for logging DEBUG<INFO<WARN<ERROR<FATAL. -->
>   <root>
>         <priority value = "info"/>
>     <appender-ref ref="ASYNC"/>
>   </root>
> </log4j:configuration>
>
> I'm running into this problem after I have extended the Layout class.  I
> extended the layout class so I can have header info in each of the log
> files.  If I used
> <layout class="org.apache.log4j.PatternLayout">
>   <param name="ConversionPattern"
>     value="%d{yyyy-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/>
>
> instead I have no rollover problems.
>
> Now what I see is I just get one file of 4KB rolling over onto itself, but I
> get the header info.
>
> Any ideas??
>
> Thanks in advance
> --
> View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7123228
> 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
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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