0
votes

I would like to use Castle Windsor 2.0 as the inversion of control container for my application and log4net 1.2.10 to provide logging services. Some Google searches suggest that Windsor provides some logging facilities and that I am supposed to create a public ILogger property on the classes that Windsor is instantiating. That sounds easy enough, but what do I need to add to app.config so I will get an ILogger that uses log4net?

The examples I have seen seem to come from an older version of Castle Windsor since they reference DLLs and namespaces that are not in the distrubution I downloaded. In particular, I do not see and Castle.Facilities.* namespace that contains logging objects. Some of these seem to have been moved to Castle.Core.Logging?

Any help is appreciated.

UPDATE:

Based on the answers below and further research, here is my current understanding.

Castle Project package release 1.0 RC3 includes many different components, including the MicroKernel, Windsor, and Services projects. The log4net integration I want is from the Services project. So, if I were to download the 1.0 RC3 package, everything I need is in one nice package.

However, the 1.0 RC3 version is really old.

As of some time relatively recently, the Castle Project components are only offered separately. Since I downloaded only the Windsor 2.0, I would not see the latest and greatest version of the Services project. Furthermore, the Services project has not had an official release since 1.0 RC3. I am not sure if I can just reference the 1.0 RC3 version or need to build my own from the latest code.

2

2 Answers

2
votes

Here is a exaclty what you need as well I believe: Where & How Castle Windsor sets up logging facility

1
votes

To use the logging facility with Castle Windsor 2.0 you have to pull the source code from the subversion repository (http://svn.castleproject.org:8080/svn/castle/tags/Windsor-2.0) and start ClickToBuild.cmd

The necessary assemblies (Castle.Facilities.Logging.dll, Castle.Services.Logging.Log4netIntegration.dll) can then be found in \build\net-3.5\release

If you do not want to pull the source and build it yourself, you can go to http://www.castleproject.org:8090/ and download the build artifact of the Windsor 2.x Release build.