public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data) { if ((Filter != null) && !Filter.ShouldTrace(eventCache, source, eventType, id, null, null, data, null)) { return; } LogEntry entry = data as LogEntry; if (entry != null) { WeblogEmailMessage message = new WeblogEmailMessage(_toAddress, _fromAddress, _subjectLineStarter, _subjectLineEnder, _smtpServer, _smtpPort, _enableSsl, _userName, _password, entry, Formatter); message.Send(); InstrumentationProvider.FireTraceListenerEntryWrittenEvent(); } else if (data is string) { Write(data); } else { base.TraceData(eventCache, source, eventType, id, data); } }
public override void Write(string message) { WeblogEmailMessage mailMessage = new WeblogEmailMessage(_toAddress, _fromAddress, _subjectLineStarter, _subjectLineEnder, _smtpServer, _smtpPort, _enableSsl, _userName, _password, message, Formatter); mailMessage.Send(); }