When making a custom adapter (Neuron.Esb.Adapters.ESBAdapterBase), it is possible to raise an error event RaiseAdapterError.
Are there any possibility to log an event/message in a CustomPipelineStep?
Tags: CustomPipelineStep, Logging
If you want to add an event to the Neuron ESB v3 event log, use this from a code step:
System.Diagnostics.EventLog.WriteEntry("Neuron ESB v3", "<your event info>", System.Diagnostics.EventLogEntryType.Warning);
Why do we need to write directly to the Event Log? Isn't that the purpose of the RaiseAdapterError method?
The Neuron API.chm doc I have states in the Remarks section that "[RaiseAdapterError] Invokes OnAdapterError and logs the message into the Neuron ESB Windows event log." Is the documentation out of date? At the top of this entry it states: "Assembly: Neuron.Esb (in Neuron.Esb.dll) Version: 2.5.0.0 (2.5.0.0)" I have version 3.1.0.275 installed and this doc was installed with it.
in your class, that derives from PipelineStep<ESBMessage>, you can put functions like this to read the traceflags of the esb service runtime:
private bool IsDebug()
{
return _traceSwitch.Level == TraceLevel.Verbose;
}
then, within your code, you can do trace statements like this:
if (IsDebug()) Neuron.Esb.Logging.ESBLoggingHelper.LogAppInfo(Neuron.Esb.Logging.ESBAppEventInfo.ESBAppEventSource.PipelineHelper, string.Format("Zip CleanFileName: Original = {0}. Cleaned = {1}: Topic = {2}. Party = {3}. Process = {4}. Process Step {5}. Message ID = {6}", original, fileName, context.Data.Header.Topic, context.Data.Header.SourceId, context.Instance.Pipeline.Name, context.Instance.CurrentStep.Name, context.Data.Header.MessageId));
there are LogAppInfo, LogAppWarning, LogAppError methods
I am using the following statement for logging from WFL step:
Neuron.Esb.Logging.ESBLoggingHelper.LogAppInfo(Neuron.Esb.Logging.ESBAppEventInfo.ESBAppEventSource.ClientContext,"####Starting####");
It is logging to Event Log. Shouldn't it be logging to Neuron log?
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by