logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Heinzel <bernhard.hein...@live.com>
Subject RE: Programatically specify output file.
Date Wed, 05 Aug 2009 13:04:58 GMT

Thank you Ross.

Works perfectly fine.

Best Regards.
Bernhard

Date: Wed, 5 Aug 2009 07:54:35 -0500
Subject: Re: Programatically specify output file.
From: rosshinkley@gmail.com
To: log4net-user@logging.apache.org

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


_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/
Mime
View raw message