logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Hinkley <rosshink...@gmail.com>
Subject Re: Programatically specify output file.
Date Wed, 05 Aug 2009 12:54:35 GMT
A quick google search yielded this:

http://stackoverflow.com/questions/571876/best-way-to-dynamically-set-an-appender-file-path

You can leverage the %property{} part of log4net to accomplish what you're
asking.

Unfortunately, if you have multiple appenders all using that property, it
will be changed for all of them as it's a global property.  If that's a
limitation, let me know.

Hope this helps,
Ross

On Wed, Aug 5, 2009 at 4:12 AM, Bernhard Heinzel
<bernhard.heinzel@live.com>wrote:

>  Hi,
>
> is it possible to confige a RollingFileAppender in the configfile and
> specify the output file programatically?
>
> My usecase is that I want to log in different files (e.g. agent.5.out,
> agent.4.out, ...) but the appender which will be used should be configured
> in the config file.
>
> Any Suggentions?
>
> Thanks.
>
> Bernhard
>
> ------------------------------
> See all the ways you can stay connected to friends and family<http://www.microsoft.com/windows/windowslive/default.aspx>
>

Mime
View raw message