Re: FileAppender append="false" does not truncate the file on startup

2015-09-02 Thread Ralph Goers
You have both the FileAppender and RollingFileAppender writing to the same 
file. This is certainly going to cause problems. I wouldn't be surprised at all 
if Java causes them to share the same OS  File and stream objects so only one 
of the ones Java requests actually works.  If it didn't do these you would 
almost certainly end up with a corrupted output file.

Ralph

> On Sep 2, 2015, at 12:25 AM, Sharath Gururaj  wrote:
> 
> @Remko, Yes, the actual behaviour is that log4j is appending to end of
> existing file instead of truncating it.
> 
> This is happening only in the presence of another RollingFileAppender which
> sits alongside the FileAppender.
> If only the FileAppender is present, then truncation works as expected.
> 
> Please find my log4j config here
> 
> My log4j config 
> 
> And this is my output from DEBUG on configuration
> DEBUG configuration output 
> 
> If this is indeed a bug, I'd like to try and submit a patch :)
> 
> Regards
> Sharath
> 
> On Wed, Sep 2, 2015 at 10:06 AM, Ralph Goers 
> wrote:
> 
>> Can you also add status=“DEBUG” to your configuration and provide that?
>> I’d like to see what is being passed through the configuration.
>> 
>> Ralph
>> 
>>> On Sep 1, 2015, at 4:41 PM, Remko Popma  wrote:
>>> 
>>> Can you provide your full configuration? (You may want to raise a Jira
>> ticket to track this issue.)
>>> 
>>> To confirm, the actual behaviour is that log4j appends to the end of the
>> existing app.log file, is that correct?
>>> 
>>> Sent from my iPhone
>>> 
 On 2015/09/02, at 2:50, Sharath Gururaj  wrote:
 
  
 
  >>> />
 
  
 
 
 I expect app.log to be truncated on my application startup.
 
 This is not the case. It is never truncated. Please help
 
 
 Thanks
 
 Sharath
>>> 
>>> -
>>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>> 
>>> 
>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
>> 


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



Re: FileAppender append="false" does not truncate the file on startup

2015-09-01 Thread Remko Popma
Can you provide your full configuration? (You may want to raise a Jira ticket 
to track this issue.)

To confirm, the actual behaviour is that log4j appends to the end of the 
existing app.log file, is that correct? 

Sent from my iPhone

> On 2015/09/02, at 2:50, Sharath Gururaj  wrote:
> 
>
> 
> />
> 
>
> 
> 
> I expect app.log to be truncated on my application startup.
> 
> This is not the case. It is never truncated. Please help
> 
> 
> Thanks
> 
> Sharath

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



Re: FileAppender append="false" does not truncate the file on startup

2015-09-01 Thread Ralph Goers
Can you also add status=“DEBUG” to your configuration and provide that? I’d 
like to see what is being passed through the configuration.

Ralph

> On Sep 1, 2015, at 4:41 PM, Remko Popma  wrote:
> 
> Can you provide your full configuration? (You may want to raise a Jira ticket 
> to track this issue.)
> 
> To confirm, the actual behaviour is that log4j appends to the end of the 
> existing app.log file, is that correct? 
> 
> Sent from my iPhone
> 
>> On 2015/09/02, at 2:50, Sharath Gururaj  wrote:
>> 
>>   
>> 
>>   > />
>> 
>>   
>> 
>> 
>> I expect app.log to be truncated on my application startup.
>> 
>> This is not the case. It is never truncated. Please help
>> 
>> 
>> Thanks
>> 
>> Sharath
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 



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