Semantic Logging out-of-process logging error in EventViewer

Topics: Semantic Logging Application Block
Jul 10, 2013 at 4:03 PM
Hi,

Can anyone let me know how to avoid this error or is there a fix expected?

Here's a snapshot from EventViewer
ProviderId : d1ed7ec7-5701-5554-2c5e-796dc42511c5
EventId : 800
Keywords : 4
Level : Error
Message : An unhandled exception occurred for the trace session 'Microsoft-SemanticLogging-Etw-RollingFlatFileSink'. Message: System.Exception: Reading past end of event
at Diagnostics.Tracing.TraceEvent.GetUnicodeStringAt(Int32 offset) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\TraceEvent1.2.7\TraceEvent.cs:line 1111
at Diagnostics.Tracing.Parsers.DynamicTraceEventData.PayloadValue(Int32 index) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\TraceEvent1.2.7\DynamicTraceEventParser.cs:line 786
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.CreatePayload(TraceEvent traceEvent) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 198
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.CreateEventEntry(TraceEvent traceEvent) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 184
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.ProcessEvent(TraceEvent evt) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 149
Opcode : Info
Task : 64734
Version : 0
Payload : [sessionName : Microsoft-SemanticLogging-Etw-RollingFlatFileSink] [message : System.Exception: Reading past end of event
at Diagnostics.Tracing.TraceEvent.GetUnicodeStringAt(Int32 offset) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\TraceEvent1.2.7\TraceEvent.cs:line 1111
at Diagnostics.Tracing.Parsers.DynamicTraceEventData.PayloadValue(Int32 index) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\TraceEvent1.2.7\DynamicTraceEventParser.cs:line 786
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.CreatePayload(TraceEvent traceEvent) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 198
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.CreateEventEntry(TraceEvent traceEvent) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 184
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.ProcessEvent(TraceEvent evt) in c:\Builds\40\EntLib\ELV6-Blocks-NuGet\src\Source\Blocks\SemanticLogging\Src\SemanticLogging.Etw\TraceEventServiceWorker.cs:line 149]
EventName : TraceEventServiceSinkUnhandledFaultInfo
Timestamp : 2013-07-09T10:39:28.2289651Z


Thanks,
Himanshu
Editor
Jul 11, 2013 at 3:56 AM
Edited Jul 11, 2013 at 3:57 AM
This post resolved the issue with a restart of IIS and the logging service.
This post resolved the issue by passing the proper parameters. The recommendation was to run the EventSourceAnalyzer.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jul 11, 2013 at 7:22 PM
Can you please let me know if this is a blocking issue, in the sense that no more messages would be logged until the service is restarted? Or is it something intermittent and can be ignored for a while? Restarting IIS would not be suitable on production sites. Please suggest.

Regards,
Himanshu
Editor
Jul 12, 2013 at 7:19 AM
Can you please let me know if this is a blocking issue, in the sense that no more messages would be logged until the service is restarted?
What behavior are you seeing?

My guess is that the error occurs when a mismatch occurs between the messages and the (generated) manifest which could occur due to user error (passing incorrect arguments) or perhaps if changes are made to the event source (which may occur during development) it could cause issues. From the developer's guide:
The methods in your custom EventSourceclass will be called from multiple places in your
application, and possibly from multiple applications if you share the same EventSourceclass. You
should take care when you modify your EventSourceclass, that any changes you make do not have
unexpected consequences for your existing applications. If you do need to modify your EventSource
class, you should restrict your changes to adding methods to support new log messages, and adding
overloads of existing methods (that would have a new event ID). You should not delete or change
the signature of existing methods.

This is especially important in light of the fact that if you have multiple versions of your EventSource
class in multiple applications that are using the Semantic Logging Application Block out-of-process
approach, then the version of the event schema that the host service uses will not be predictable.
You should ensure that you have procedures in place to synchronize any changes to the EventSource
class across all of the applications that share it.
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to