If the configuration is contained in web.config and the business layer assembly executes in the same appdomain as the Web API application then the only thing you will need to do is bootstrap the blocks you are using (in this case it sounds like just logging).
You could do this at application startup (e.g. App_Start):
Logger.SetLogWriter(new LogWriterFactory().Create());
In this approach the Business Layer will use the static facade Logger.Write
to write LogEntries.
A better approach would be to create a small wrapper around a LogWriter that will bootstrap the block and expose the LogWriter
for use in the business layer (and anywhere that needs logging). This is a bit more friendly for dependency injection since it's easy to register in a container and can be passed in as a dependency.
public class Logger
{
private Lazy<LogWriter> logWriter = new Lazy<LogWriter>(() =>
{
LogWriterFactory factory = new LogWriterFactory();
return factory.Create();
});
public LogWriter LogWriter
{
get { return logWriter.Value; }
}
}
Since internally LogWriter is a singleton and you only want to bootstrap once you would probably make the custom Logger class a singleton. (If you don't care about having an instance you could make Logger entirely static.)