How to store the payload in separate columns using the Semantic Logging Application Block's SqlDatabaseSink

550 views Asked by At

How can the SqlDatabaseSink store the payload in separate columns? It's mentioned in the documentation, but I haven't seen it done anywhere. When I've tried, the payload is always stored as a JSON string. Any ideas?

Source: Developing event sources using the .NET EventSource class

Under "Specifying the event and its payload" it states:

Some sinks will store payload items individually; for example, the SQL Database sink and the Azure Table Storage sink in the Semantic Logging Application Block store each payload item in a separate column.

Is the documentation wrong regarding the SqlDatabaseSink? I've heard DEVs claim that the Azure Sink works.

2

There are 2 answers

0
clarionprogrammer On

It turns out that the documentation is incorrect after all. It only works with the Azure Sink as explained here by an Enterprise Library Support Engineer.

0
Peter Bons On

You can alter the source so the payload is stored in an XML column in Sql Server, that makes for easy querying. See this fork: https://github.com/DeHeerSoftware/semantic-logging