You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Chris White <cw...@gmail.com> on 2008/01/17 00:21:04 UTC

GlobalContext.Properties, RollingFileAppender, and PatternString

I have multiple services running using log4net on a system and would like to
globally set the base logging directory programmatically at startup.

It seems I should be able to set a BaseLogsDirectory property in
GlobalContext.Properties and use it in a pattern string like this:

<file type="log4net.Util.PatternString"
value="%property{BaseLogsDirectory}\logfilename" />

Although the property seems to added, the next log call ends up creating a
"(null)" directory in the executing assembly's directory, where the files
end up.

Am I forgetting something?

Thanks,
Chris