title: How can I resolve ILog using ServiceStack and Funq.Container
body: <p>The ServiceStack AppHost provides a Funq.Container with which to register types that can be injected into Services as they are constructed.  Can this container be used to register an ILog factory that returns an ILog appropriate for the type in which it will reside?</p>
  
  <p>Put another way, given the following AppHost:</p>
  
  <pre><code>public class AppHost : AppHostBase
  {
      public AppHost() : base("Example Web Services", Assembly.GetExecutingAssembly())
      {
      }
  
      public override void Configure(Funq.Container container)
      {
          var baseLogFactory = new ServiceStack.Logging.NLogger.NLogFactory();
          LogManager.LogFactory = new ServiceStack.Logging.Elmah.ElmahLogFactory(baseLogFactory);
          // Would prefer to register a Func&lt;Type, ILog&gt; one time here
      }
  }
  </code></pre>
  
  <p>And a Service:</p>
  
  <pre><code>public class FooService : IService&lt;FooRequest&gt;
  {
      static ILog Log { get { return LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); } }
      // Would prefer:
      // public ILog { get; set; }
  
      public object Execute(FooRequest request)
      {
          Log.Info("Received request: " + request.Dump());
          return new FooResponse();
      }
  }
  </code></pre>
  
  <p>Is there anything I can add to AppHost.Configure to avoid the static ILog boilerplate in all of my Services (and instead just use a plain old ILog property)?</p>
  
  <p>Put a third way, most succinctly, Can I use Funq.Container for ILog injection instead of LogManager?</p>