SQL Exception for request and responses
See original GitHub issueI implemented this package for logging in my Web API application to monitor logs
here is my configurations in my service collection :
services.AddWatchDogServices(opt => { opt.ClearTimeSchedule = WatchDogAutoClearScheduleEnum.Monthly; opt.IsAutoClear = true; opt.SqlDriverOption = WatchDogSqlDriverEnum.MSSQL; opt.SetExternalDbConnString = Configuration.GetConnectionString("DefaultConnection"); });
and here is my appBuilder configuration :
app.UseWatchDogExceptionLogger(); app.UseWatchDog(opt => { opt.WatchPageUsername = "xxxx"; opt.WatchPagePassword = "xxxx"; });
For any request and response that is success and returns correct value, I have got exception as below
What I’m missing in implementation ?
Why Logging is not working correctly ?
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader() at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult) at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action
1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location --- at Dapper.SqlMapper.ExecuteImplAsync(IDbConnection cnn, CommandDefinition command, Object param) in /_/Dapper/SqlMapper.Async.cs:line 646 at WatchDog.src.Helpers.ExternalDbHelper.InsertWatchLog(WatchLog log) at WatchDog.src.Managers.DynamicDBManager.InsertWatchLog(WatchLog log) at WatchDog.src.WatchDog.InvokeAsync(HttpContext context) at WatchDog.src.WatchDogExceptionLogger.InvokeAsync(HttpContext context)
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
@devFarshadFahimi @ksarankumar A new version (v1.3.2) with the fix has been released. Update the WatchDog.NET package in your project and you should be good to go.
Great, that has already been fixed and a new version will be deployed soon.