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 krista <kr...@baesystems.com> on 2008/06/18 21:01:57 UTC
How to use a RollingFileAppender asynchronously?
I was wondering if anyone knew if there was a built in way to use a
RollingFileAppender combined with the AsyncAppender? I have a log file that
needs rollover capability and that multiple processes will be hitting. This
seems like a pretty common thing to need, but I can't find any references to
it anywhere.
I've seen that the AsynchAppender has an addAppender method, but how exactly
does that work, and what if I want to configure it all in my property file?
Do I need to load the property file containing the AsynchAppender and then
attach the RollingFileAppender programmatically?
Thank you in advance for any responses.
--
View this message in context: http://www.nabble.com/How-to-use-a-RollingFileAppender-asynchronously--tp17989557p17989557.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 use a RollingFileAppender asynchronously?
Posted by Michael Erskine <mi...@ketech.com>.
krista [mailto:krista.withee@baesystems.com]wrote:
> Okay. What if I have multiple threads within a single process trying to
> write to the same file?
That's fine: I've never encountered any problems with many threads logging with the same FileAppender.
For multiple processes I use a suitably crafted JDBC appender (I'll publish it one day!)
Regards,
Michael Erskine.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: How to use a RollingFileAppender asynchronously?
Posted by krista <kr...@baesystems.com>.
Okay. What if I have multiple threads within a single process trying to
write to the same file?
James A. N. Stauffer wrote:
>
> Multiple processes can't write to the same file even with
> AsyncAppender. AsyncAppender is so that logging doesn't have to wait
> for the message to be written when the underlying appender could take
> a while to write.
>
> James A. N. Stauffer http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
>
> On Wed, Jun 18, 2008 at 2:01 PM, krista <kr...@baesystems.com>
> wrote:
>>
>> I was wondering if anyone knew if there was a built in way to use a
>> RollingFileAppender combined with the AsyncAppender? I have a log file
>> that
>> needs rollover capability and that multiple processes will be hitting.
>> This
>> seems like a pretty common thing to need, but I can't find any references
>> to
>> it anywhere.
>>
>> I've seen that the AsynchAppender has an addAppender method, but how
>> exactly
>> does that work, and what if I want to configure it all in my property
>> file?
>> Do I need to load the property file containing the AsynchAppender and
>> then
>> attach the RollingFileAppender programmatically?
>>
>> Thank you in advance for any responses.
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-use-a-RollingFileAppender-asynchronously--tp17989557p17989557.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
>>
>>
>
> ---------------------------------------------------------------------
> 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/How-to-use-a-RollingFileAppender-asynchronously--tp17989557p18386111.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 use a RollingFileAppender asynchronously?
Posted by "James A. N. Stauffer" <st...@gmail.com>.
Multiple processes can't write to the same file even with
AsyncAppender. AsyncAppender is so that logging doesn't have to wait
for the message to be written when the underlying appender could take
a while to write.
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
On Wed, Jun 18, 2008 at 2:01 PM, krista <kr...@baesystems.com> wrote:
>
> I was wondering if anyone knew if there was a built in way to use a
> RollingFileAppender combined with the AsyncAppender? I have a log file that
> needs rollover capability and that multiple processes will be hitting. This
> seems like a pretty common thing to need, but I can't find any references to
> it anywhere.
>
> I've seen that the AsynchAppender has an addAppender method, but how exactly
> does that work, and what if I want to configure it all in my property file?
> Do I need to load the property file containing the AsynchAppender and then
> attach the RollingFileAppender programmatically?
>
> Thank you in advance for any responses.
> --
> View this message in context: http://www.nabble.com/How-to-use-a-RollingFileAppender-asynchronously--tp17989557p17989557.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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org