Apparently, the query is never logged if the query fails. This means the log doesn't contain the query anytime the query fails - this defeats the whole purpose of having the query logged.
It seems as though the query is logged only after it is executed as opposed to before its execution. If this is the case, that's a major limitation. This means anytime there is a failed query, it is unknown what query failed.
Below is an example of the log w/o query - all I get is the error/trace.
*** ERROR: An exception was caught during the execution of an action query: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ContactIdentification_Type_MB". The conflict occurred in database "Test2_11", table "dbo.Type", column 'TypeID'.
The statement has been terminated.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ContactIdentification_Type_MB". The conflict occurred in database "Test2_11", table "dbo.Type", column 'TypeID'.
The statement has been terminated.
11/2/2012 5:59:02 PM|th#9256|General | at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteActionQuery(IActionQuery queryToExecute, ITransaction containingTransaction)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.AddNew(IEntityFields fields, ITransaction containingTransaction)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.InsertEntity()
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.CallInsertEntity()
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PersistQueue(List`1 queueToPersist, Boolean insertActions, ITransaction transactionToUse, Int32& totalAmountSaved)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save(IPredicate updateRestriction, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save()
Ron