/// <summary> /// The bootstrap. /// </summary> /// <param name="bootstrappingRequest"> /// The bootstrapping bootstrappingRequest. /// </param> /// <returns> /// The <see cref="BootstrappingResult"/>. /// </returns> public override BootstrappingResult Bootstrap(BootstrappingRequest bootstrappingRequest) { IWorkloadInspector inspector; foreach (var configFileProperty in bootstrappingRequest.Properties.Where(cp => cp.Name.Equals("log4net.ConfigurationFilePath"))) { if (!this._allowComponentTypes.Contains(bootstrappingRequest.ComponentType)) { return BootstrappingResult.Failure( new[] { "Cannot apply explicit log4net configuration to component type " + bootstrappingRequest.ComponentType + "." }); } if (!configFileProperty.Values.Any()) { continue; } var results = configFileProperty.Values.SelectMany(p => new Log4NetConfigurationUpdateService(p).Update()) .ToArray(); return results.Any() ? BootstrappingResult.Failure(results) : BootstrappingResult.Success(); } switch (bootstrappingRequest.ComponentType) { case ComponentType.PublicAspNet: case ComponentType.AspNet: inspector = new UserInterfaceWorkloadInspector(bootstrappingRequest); break; case ComponentType.WcfService: inspector = new WcfServiceWorkloadInspector(bootstrappingRequest); break; default: inspector = new IgnoredWorkloadInspector(); break; } return inspector.Execute(); }