title: How to configure a logging interceptor for all registered type in Unity?
body: <p>I am going to trace every actions happened in the services which are managed by the Unity Container as logs in file system. I suppose I could define an interface named IService and all the other interfaces or implementation should inherit from him. On the other hand, I would like to develop a custom interception behavior or call handler to save the logs into files. </p>
  
  <p>Unfortunately, I found that it doesn't work for me by using this codes</p>
  
  <pre><code>IUnityContainer unity = new UnityContainer();
  
  //Interception
  unity.AddNewExtension&lt;Interception&gt;();
  Interception interception = unity.Configure&lt;Interception&gt;();
  unity.RegisterType&lt;IService&gt;(
      new DefaultInterceptor(new InterfaceInterceptor()),
      new DefaultInterceptionBehavior(new LoggingBehavior()));
  
  string[] configFiles = Directory.GetFiles(".", "*.config");
  foreach (string configFile in configFiles)
  {
      var fileMap = new ExeConfigurationFileMap { ExeConfigFilename = configFile };
      System.Configuration.Configuration configuration =
          ConfigurationManager.OpenMappedExeConfiguration(fileMap,  
          ConfigurationUserLevel.None);
      var unitySection = (UnityConfigurationSection)
          configuration.GetSection("unity");
      unity = unitySection.Configure(unity);
  }
  
  IGateway imapGW = unity.Resolve&lt;IGateway&gt;("ImapGateway");
  </code></pre>
  
  <p>Is there any misunderstanding for me to use interceptor in Unity? How can I deal with this issue to log everything automatically without configuring interceptor for each service?</p>