1
votes

This guy asked pretty much the same question.

I am currently using castle logging facility in an MVC application and loading currently a single named logger in global.asax, which doesn't make it easy to separate multiple log files with the same level, without getting the same log records output to multiple files. LoggerToMatch is what I am after for filtering, I also have a custom log4net render that I use currently with the single named logger and I have need to for different named loggers to use different custom renders.

I think Krzysztof's answer here is what I am after but I don't know what these parameters are k,c.

If have a log4net config file that looked like this how would I resgister both named loggers with Windsor? Up until now I have been telling Windsor about a single named logger when registering the facility.

    <logger name="Logger1">
        <level value="INFO" />
        <appender-ref ref="ErrorRollingFile1" />
        <appender-ref ref="TraceRollingFile1" />
        <appender-ref ref="InfoRollingFile1" />
    </logger>

    <logger name="Logger2">
        <level value="INFO" />
        <appender-ref ref="ErrorRollingFile2" />
        <appender-ref ref="TraceRollingFile2" />
        <appender-ref ref="InfoRollingFile2" />
    </logger>
1

1 Answers

0
votes
UsingFactoryMethod((k, c)

UsingFactoryMethod gives you the possibility to access k=IKernel and c=CreationContext

through the "k" you can explicitly access&resolve components from the container(IKernel is the "kernel/core" of the container)

through "c" you have details on the parent context.