ILMerge + Castle + Log4Net

At work we have recently merged the various Castle assemblies into one with ILMerge. It has worked great, but we found one gotcha with the Log4Net facility. Castle’s LoggingFacility class defines class types of various logging factories as static strings, which aren’t picked up by ILMerge.

The solution has two parts:
1. Use the CustomLoggerFactory config parameter: