problem writing json formatted logs

Topics: Logging Application Block
Sep 1, 2013 at 1:41 PM
Edited Sep 1, 2013 at 1:41 PM
I have used Enterprise library to create two logs. I have used FlatFileTraceListener for both logs, but different formatters for each. I have passed TextFormatter to one and JsonLogFormatter to the other. The first one works fine and creates the log and writes log entries correctly. But the second just creates the output file without any log entry written into it. Could any one please tell me what the problem might be?
Sep 1, 2013 at 4:10 PM
Edited Sep 1, 2013 at 4:11 PM
The JsonLogFormatter uses the Json.NET library. Install Json.NET from NuGet and it should work. In order to troubleshoot these types of issues set the errors special source to use a Flat File Trace Listener with no formatter (in other words make the errors special source as simple/foolproof as possible).

Randy Levy
Enterprise Library support engineer
Support How-to