namespace Wayne.Lib.Log
{
///
/// A log writer that writes to the EventLog Publisher/subscriber interface.
///
internal class EventLogSubscriptionLogWriter : LogWriter
{
#region Fields
private string subscriberId;
private LogConfigEventLogStorageType storageType;
#endregion
#region Construction
public EventLogSubscriptionLogWriter(string logName, LogConfigEventLogSubscriptionOutput output)
: base(logName)
{
subscriberId = output.SubscriberId;
storageType = output.StorageType;
}
#endregion
#region Properties
///
/// The id of the subscriber that should pick up the events from this log writer.
///
public string SubscriberId
{
get { return subscriberId; }
}
///
/// Type of storage that this log writer manages.
///
internal LogConfigEventLogStorageType StorageType
{
get { return storageType; }
}
#endregion
#region Methods
///
/// Publishes the specified entry to the event publisher. If it is not
/// an event log entry, it is just ignored.
///
///
public override void PerformWrite(LogEntry logEntry)
{
EventLogEntry eventLogEntry = logEntry as EventLogEntry;
//if (eventLogEntry != null)
// Logger.PublishEventLog(this.subscriberId, eventLogEntry);
}
///
/// Disposes the internal resources.
///
///
///
protected override void Dispose(bool disposing, string reason)
{
}
#endregion
}
}