title: Log4Net to Oracle -> PatternLayout fails with "converterType is null"
body: <p>I'm running 15 parallel Powershell processes so I can't log to a file, and I can't flood the Application Event viewer. Logging to a database makes perfect sense. My problem seems to be a common one, but the only solution I've found is to hand code the Log4Net implementation rather than setting up a straightforward config file. This sounds wrong to me. I can't imagine there's no way around this config issue, but perhaps someone can point me to a more complete answer. </p>
  
  <p>Full discussion of the issue exists at:
  <a href="http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/604400d5-3383-421a-8b62-716280a82232/" rel="nofollow">Social.Technet</a></p>
  
  <p>My config is per Apache specs for Oracle 9 databases:  <a href="http://logging.apache.org/log4net/release/config-examples.html" rel="nofollow">Apache Config Docs</a></p>
  
  <p>The first parameter uses the RawTimeStampLayout and works like a charm. The second parameter attempts to use the PatternLayout and fails. </p>
  
  <pre><code>&lt;parameter&gt;
      &lt;parameterName value=":log_date" /&gt;
      &lt;dbType value="DateTime" /&gt;
      &lt;layout type="log4net.Layout.RawTimeStampLayout" /&gt;
  &lt;/parameter&gt;
  &lt;parameter&gt;
      &lt;parameterName value=":message" /&gt;
      &lt;dbType value="String" /&gt;
      &lt;size value="255" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%message" /&gt;
      &lt;/layout&gt;
  &lt;/parameter&gt;
  </code></pre>
  
  <p>When I attempt to add a message using PatternLayout, I receive:</p>
  
  <pre><code>log4net:ERROR XmlHierarchyConfigurator: Could not create Appender  [AdoNetAppender_Oracle] of type [log4net.Appender.AdoNetAppender]. 
  Reported error follows.
  System.ArgumentNullException: CreateConverterInstance cannot create instance, converterType is null
  Parameter name: converterType
  </code></pre>
  
  <p>Exactly like everyone else, if I use the RawPropertyLayout instead of PatternLayout I no longer receive the error, but I only log NULLs for those fields. </p>
  
  <p>Per the discussion on Social.Technet, one way to make the logging work is to use code to create the parameters like this:</p>
  
  <pre><code>$param2 = New-Object log4net.Appender.AdoNetAppenderParameter
  $param2.ParameterName = "@log_level"
  $parm2Layout=New-Object log4net.Layout.PatternLayout("%level")
  $param2.Layout = New-Object log4net.Layout.Layout2RawLayoutAdapter($parm2Layout)
  $param2.DbType = "String"
  $param2.Size = 50
  $sqlAppender.AddParameter($param2)
  </code></pre>
  
  <p>Note that the PatternLayout is created then manually fed to the 2RawLayout Adapter. This seems to be the step missing in the config conversion process. </p>
  
  <p>Does anyone know of a better way? Does anyone have a working PowerShell-Log4Net-Oracle config laying around?</p>