Unwanted splitting of messages


(dsever) #1

Hi,

I’m sending message to syslog using UDP. Have the situation that message is multi lined, and in that case every line is new message. So how to handle situation like this (example of message is in the mottom of email). The result I want to get is to have complete message not multiple messages

Thanks

Example:

08:12:08,679 ERROR caa50b942c0e4981b427057eb8c336d9 ExceptionExtensions.Log - 
Call stack:
CustomerDeviceListGet - customerReferenceID=, operatorReferenceID=1, suboperatorReferenceID=, username=, password=
CustomerDeviceListGet - customerReferenceID=, operatorReferenceID=1, suboperatorReferenceID=, username=
System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'customer_get_deviceInstance_list' expects parameter '@customer_externalID', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

(Jan Doberstein) #2

please put your log into code blog to be better readable:


YOUR LOG


if you have Multiline Logfiles you will need to use another shipper that can work with multi line messages. For example filebeat, controlled by the collector sidecar.


(dsever) #3

Hi
Thanks for your answer, I fact we are using log4net, and it sends exception message in multi lined.

Maybe better approach would to wrap every single line with date and GUID that is related to event.

Dubravko