tag:blogger.com,1999:blog-2672427473119923109.post1341062848747366990..comments2023-09-27T08:00:43.263-07:00Comments on Marco Craveiro: Nerd Food: Using Mono In Anger - Part IIIMarco Craveirohttp://www.blogger.com/profile/01039195055988254979noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2672427473119923109.post-79423437889699356812014-06-02T14:25:13.451-07:002014-06-02T14:25:13.451-07:00Cheers Scott, will update the code with this!Cheers Scott, will update the code with this!Marco Craveirohttps://www.blogger.com/profile/01039195055988254979noreply@blogger.comtag:blogger.com,1999:blog-2672427473119923109.post-66770640580332004702014-05-29T05:00:44.767-07:002014-05-29T05:00:44.767-07:00Windsor
Food for thought, rather than having your ...<b>Windsor</b><br />Food for thought, rather than having your main project having to wire up every installer amongst all projects, I have what I like to call the WindsorContainerInitialiser. This is called from the main project and loads all project related DLLs containing an IWindsorInstaller implementation.<br /><br /><b>With your log4net</b><br />Windsor has a Logging Facility, also as a nuget package "Castle Windsor logging facility", of which Log4Net is provided "Castle.Core log4net integration 3.0" ... so this achieves the same as your log4net dynamic properties but without the pain. Wire up to Windsor like so;<br /><br />container.AddFacility(lf => lf.UseLog4Net());<br /><br />And hey presto, any IoC managed class can have the magic ILogger which uses the single log4net config file;<br /> <br />private ILogger _logger = NullLogger.Instance;<br /><br />public ILogger Logger<br />{<br />get { return _logger; }<br />set { _logger = value; }<br />}<br /><br /><br />;-)Scott Findlaterhttps://www.blogger.com/profile/07324523069794537212noreply@blogger.com