Click here to Skip to main content
15,887,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have configured enterprise library logging application block 5.0. I have successfully logged in flat file, however concern here is I am getting extended properies twice one section with repetive information.

Following is my log:

CSS
----------------------------------------
Timestamp: 10/24/2012 3:22:10 PM

Message: Timestamp: 10/24/2012 3:22:10 PM
Message:
Category: DataAccesslayer
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: ROHIT1647
App Domain: SOA.TetstClient.Console.vshost.exe
ProcessId: 9448
Process Name: D:\Rohit\Projects\99Cents\Work\SOA\TestClient\SOA.TetstClient.Console\bin\Debug\SOA.TetstClient.Console.vshost.exe
Thread Name:
Win32 ThreadId:35612
Extended Properties:
Category: DataAccessLayer
Priority: -1
EventId: 1
Severity: Information
Title:
Machine: ROHIT1647
App Domain: SOA.TetstClient.Console.vshost.exe
ProcessId: 9448
Process Name: D:\Rohit\Projects\99Cents\Work\SOA\TestClient\SOA.TetstClient.Console\bin\Debug\SOA.TetstClient.Console.vshost.exe
Thread Name:
Win32 ThreadId:35612
Extended Properties:



My text formatter is something like below:

CSS
Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline})}



Please suggest whats wrong here?

Thanks
Rohit
Posted

1 solution

Sorry guys, figured out my silly mistake.

I was using wrong overload of Logger.Write.

changed
EntLib.Logger.Write(logEntry, extendedProperties);
to
EntLib.Logger.Write(logEntry);


It was treating logentry as message. :(
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900