I'm struggling to get the correct textblock on some of my logfiles.
Example of textblock i want the Format Rules to pick up:
03.05.2014 00.46.02.828 Error Exception occured:, System.Data.SqlClient.SqlException: 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.'
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
03.05.2014 00.46.10.234 Information Start - VerifyRegistration
I want the format rule start on the first line of the Error-line, and include the last line of the exception. I've been trying to use the fact that all the exception-lines start with 3 whitespaces, but my regex-skills hav'nt proven good enough. Initially I included the next line with timestamp and Information/Error, but that can make me miss errors.
A additional thing causing me to struggle is that it's not always exceptions on the errors. I don't want to miss those either.
Do any of you see any way to achieve this?
I tried using multiple watchers, but could'nt get that to work either.
Hope someone has a hint/tip on how to accomplish this.
I've tried using lookahead in regex, so I dont include the linje I get a match on. No luck so far.
Dont seem to match blank line in regex either. I thougt i could use \z|\Z, but cant get that to work either. Seems like I'm currently out of luck here.