strange thing is that this works when using LogName as a parameter in
log message pattern, but not for file name so I guess it's rather
log4net related problem and nothing windsor-specific...

log4net.GlobalContext.Properties["LogName"] = logName;
container.AddFacility("logging", new LoggingFacility
(LoggerImplementation.Log4net));
container.Resolve<ILogger>().Debug("test");



On 27 říj, 12:30, Filip Kinsky <[email protected]> wrote:
> I'm using LoggingFacility for accessing ILogger in my application and
> now I'd like to be able to set log4net properties. I need to be able
> to define log file name programatically depending on parameters my
> application is launched with. This should be set just once on
> application startup and all the ILoggers supplied by container should
> reflect it. So I defined my log4net.config file like this:
>
> ...
> <appender name="rollingFile"
> type="log4net.Appender.RollingFileAppender,log4net" >
>
>                         <param name="File" value="%property{LogName}" />
> ...
>
> and already tried to call log4net.GlobalContext.Properties["LogName"]
> = "xxx.log" before registering windsor logging facility etc, but I'm
> not able to get it working - I'm still getting logs generated into
> "%property{LogName}" file. I was already looking into
> ExtendedLog4netLogger.GlobalProperties and tried to use it, but it
> also didn't work. I looked into its source code, but it seems that the
> GlobalProperties property isn't used to set real
> log4net.GlobalContext.Property at all?!
>
> Did anyone succeeded in using log4net properties with Castle
> LoggingFacility? I guess I could write my own ILoggerFactory/ILogger
> implementation, but this would consume quite a lot of time for such
> simple thing...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to