Alternative to JSON messages in DB for out-of-process scenario

Topics: Semantic Logging Application Block
May 28, 2013 at 4:57 PM
I'm using out-of-process SLAB in my application and logging traces in DB. The framework logs JSON formatted traces in the Payload column.

If there a way to change it to different format say XML or customFormatters?

I tried using XMLtextformatter and CustomTextFormatter inside DB sink configuration but it raised an error saying "Tag is not supported" but when I insert XMLTextFormatter inside FlatFile it does log the traces in XML format. So it appears that DB traces will only be in JSON format? Is that true and can we apply another textFormatter for DB traces?
May 30, 2013 at 11:04 PM

As you noticed, the JSON format for DB sinks is fixed so you can only use the formatters with file based or custom sinks.
However, you can still overcome this "limitation" thanks to the extensibility mechanisms provided by writing a custom sink and tweaking the data in the event stream using Reactive Extensions before the payload is written to the DB.
You can find this approach with sample code here.