cjbhaines / Log4Net.Async

Asynchronous Log4Net appenders and forwarder
http://www.nuget.org/packages/Log4Net.Async/
MIT License
121 stars 37 forks source link

logging not happening for "log4net.Appender.ADONetAppender", if using commandtype as stored procedure to log #16

Closed here2code closed 8 years ago

here2code commented 8 years ago

Hi, First of all thanks for such a nice utility, i am using nuget package latest version, using which i am able to log using file appender, also with ADONetAppender, if log via a insert query. but the moment i start using commandType as StoredProcedure, it fails to log. I am not sure whether currently this utility is done to support only insert query only, but if it can work with stored procedure as well, then let me know a way to do or fix for same, that would be great help.

using this one fails: commandType value as StoredProcedure

Note: Same ado appender works fine as it is, if i don't use async appenders from either one, AsyncForwardingAppender or ParallelForwardingAppender, but the moment i forward that via async appenders, it stops logging in db.

rcollette commented 8 years ago

It would be helpful if you could post your working and non-working log4net configurations. Off the top of my head, I can't think of why stored procedures would specifically have a problem logging if you can successfully do insert style logging. What database are you using? I would avoid using more than one async /parallel appender for the same database connection instance.

cjbhaines commented 8 years ago

@here2code can you supply configs please? I have not experienced any issues like you mention when using the libraries. Without any further information we will have to close this.

vivek-meka commented 8 years ago

@here2code Can you post the error details. If you are not capturing the error details here is how to do it.

 <system.diagnostics>
    <trace autoflush="true">
      <listeners>
        <add
            name="textWriterTraceListener"
         type="System.Diagnostics.TextWriterTraceListener"
         initializeData="C:\Path\log4net.txt" />
      </listeners>
    </trace>
  </system.diagnostics>

and add this to your app settings to enable internal debugging

<appSettings>
      <add key="log4net.Internal.Debug" value="true"/>
   </appSettings>

This will give you the actual error details