/// <summary> /// Initializes a new instance of <see cref="FormattedDatabaseTraceListener"/>. /// </summary> /// <param name="database">The database for writing the log.</param> /// <param name="writeLogStoredProcName">The stored procedure name for writing the log.</param> /// <param name="addCategoryStoredProcName">The stored procedure name for adding a category for this log.</param> /// <param name="formatter">The formatter.</param> public FormattedDatabaseTraceListener( Microsoft.Practices.EnterpriseLibrary.Data.Database database, string writeLogStoredProcName, string addCategoryStoredProcName, IMsgFormatter formatter) : base(formatter) { this.writeLogStoredProcName = writeLogStoredProcName; this.addCategoryStoredProcName = addCategoryStoredProcName; this.database = database; }
/// <summary> /// Initializes a new instance of <see cref="EmailTraceListener"/> with a toaddress, fromaddress, /// subjectlinestarter, subjectlinender, smtpserver, smtpport, and a formatter /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="toAddress">A semicolon delimited string the represents to whom the email should be sent.</param> /// <param name="fromAddress">Represents from whom the email is sent.</param> /// <param name="subjectLineStarter">Starting text for the subject line.</param> /// <param name="subjectLineEnder">Ending text for the subject line.</param> /// <param name="smtpServer">The name of the SMTP server.</param> /// <param name="smtpPort">The port on the SMTP server to use for sending the email.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> public EmailTraceListener( string toAddress, string fromAddress, string subjectLineStarter, string subjectLineEnder, string smtpServer, int smtpPort, IMsgFormatter formatter) : base(formatter) { this.toAddress = toAddress; this.fromAddress = fromAddress; this.subjectLineStarter = subjectLineStarter; this.subjectLineEnder = subjectLineEnder; this.smtpServer = smtpServer; this.smtpPort = smtpPort; }
/// <summary> /// Initializes a new instance of <see cref="MsmqTraceListener"/>. /// </summary> /// <param name="name">The name of the new instance.</param> /// <param name="queuePath">The path to the queue to deliver to.</param> /// <param name="formatter">The formatter to use.</param> /// <param name="messagePriority">The priority for the messages to send.</param> /// <param name="recoverable">The recoverable flag for the messages to send.</param> /// <param name="timeToReachQueue">The timeToReachQueue for the messages to send.</param> /// <param name="timeToBeReceived">The timeToBeReceived for the messages to send.</param> /// <param name="useAuthentication">The useAuthentication flag for the messages to send.</param> /// <param name="useDeadLetterQueue">The useDeadLetterQueue flag for the messages to send.</param> /// <param name="useEncryption">The useEncryption flag for the messages to send.</param> /// <param name="transactionType">The <see cref="MessageQueueTransactionType"/> for the message to send.</param> public MsmqTraceListener(string name, string queuePath, IMsgFormatter formatter, MessagePriority messagePriority, bool recoverable, TimeSpan timeToReachQueue, TimeSpan timeToBeReceived, bool useAuthentication, bool useDeadLetterQueue, bool useEncryption, MessageQueueTransactionType transactionType) : this(name, queuePath, formatter, messagePriority, recoverable, timeToReachQueue, timeToBeReceived, useAuthentication, useDeadLetterQueue, useEncryption, transactionType, new MsmqSendInterfaceFactory()) { }
/// <summary> /// Initializes a <see cref="FormattedTraceListenerWrapperBase"/> with an inner <see cref="TraceListener"/> /// and a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="innerListener">The wrapped listener.</param> /// <param name="formater">The formatter.</param> protected FormattedTraceListenerWrapperBase(TraceListener innerListener, IMsgFormatter formater) : base(formater) { this.innerListener = innerListener; }
/// <summary> /// Initializes a new instance of <see cref="EmailTraceListener"/> with a toaddress, fromaddress, /// subjectlinestarter, subjectlinender, smtpserver, smtpport, and a formatter /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="toAddress">A semicolon delimited string the represents to whom the email should be sent.</param> /// <param name="fromAddress">Represents from whom the email is sent.</param> /// <param name="subjectLineStarter">Starting text for the subject line.</param> /// <param name="subjectLineEnder">Ending text for the subject line.</param> /// <param name="smtpServer">The name of the SMTP server.</param> /// <param name="smtpPort">The port on the SMTP server to use for sending the email.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> /// <param name="authenticationMode">Authentication style to use when connecting to SMTP server.</param> /// <param name="userName">User name to use for authentication if using username/password authentication.</param> /// <param name="password">Password to use for authentication if using username/password authentication.</param> /// <param name="useSSL">Use SSL to connect to mail server if true, regular socket if false.</param> public EmailTraceListener( string toAddress, string fromAddress, string subjectLineStarter, string subjectLineEnder, string smtpServer, int smtpPort, IMsgFormatter formatter, EmailAuthenticationMode authenticationMode, string userName, string password, bool useSSL) : base(formatter) { this.toAddress = toAddress; this.fromAddress = fromAddress; this.subjectLineStarter = subjectLineStarter; this.subjectLineEnder = subjectLineEnder; this.smtpServer = smtpServer; this.smtpPort = smtpPort; this.authenticationMode = authenticationMode; this.userName = userName; this.password = password; this.useSSL = useSSL; }
/// <summary> /// Initializes a new instance of <see cref="FlatFileTraceListener"/> with a <see cref="StreamWriter"/> and /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="writer">The stream writer.</param> /// <param name="formatter">The formatter.</param> public FlatFileTraceListener(StreamWriter writer, IMsgFormatter formatter) : base(writer, formatter) { }
/// <summary> /// Initalizes a new instance of <see cref="FormattedTraceListenerBase"/> with a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="formatter">The <see cref="IMsgFormatter"/> to use when tracing a <see cref="MsgEntry"/>.</param> protected FormattedTraceListenerBase(IMsgFormatter formatter) { this.Formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="FormattedTextWriterTraceListener"/> with a /// <see cref="IMsgFormatter"/> and a <see cref="Stream"/>. /// </summary> /// <param name="stream">The stream to write to.</param> /// <param name="formatter">The formatter to format the messages.</param> public FormattedTextWriterTraceListener(Stream stream, IMsgFormatter formatter) : this(stream) { this.Formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="MsmqTraceListener"/>. /// </summary> /// <param name="name">The name of the new instance.</param> /// <param name="queuePath">The path to the queue to deliver to.</param> /// <param name="formatter">The formatter to use.</param> /// <param name="messagePriority">The priority for the messages to send.</param> /// <param name="recoverable">The recoverable flag for the messages to send.</param> /// <param name="timeToReachQueue">The timeToReachQueue for the messages to send.</param> /// <param name="timeToBeReceived">The timeToBeReceived for the messages to send.</param> /// <param name="useAuthentication">The useAuthentication flag for the messages to send.</param> /// <param name="useDeadLetterQueue">The useDeadLetterQueue flag for the messages to send.</param> /// <param name="useEncryption">The useEncryption flag for the messages to send.</param> /// <param name="transactionType">The <see cref="MessageQueueTransactionType"/> for the message to send.</param> /// <param name="msmqInterfaceFactory">The factory to create the msmq interfaces.</param> public MsmqTraceListener(string name, string queuePath, IMsgFormatter formatter, MessagePriority messagePriority, bool recoverable, TimeSpan timeToReachQueue, TimeSpan timeToBeReceived, bool useAuthentication, bool useDeadLetterQueue, bool useEncryption, MessageQueueTransactionType transactionType, IMsmqSendInterfaceFactory msmqInterfaceFactory) : base(formatter) { this.queuePath = queuePath; this.messagePriority = messagePriority; this.recoverable = recoverable; this.timeToReachQueue = timeToReachQueue; this.timeToBeReceived = timeToBeReceived; this.useAuthentication = useAuthentication; this.useDeadLetterQueue = useDeadLetterQueue; this.useEncryption = useEncryption; this.transactionType = transactionType; this.msmqInterfaceFactory = msmqInterfaceFactory; }
/// <summary> /// Initializes a new instance of <see cref="FormattedEventLogTraceListener"/> with an /// <see cref="IMsgFormatter"/> and a <see cref="EventLogTraceListener"/> /// initialized with source name and default log and machine names. /// </summary> /// <param name="source">The source name for the wrapped listener.</param> /// <param name="formatter">The formatter for the wrapper.</param> public FormattedEventLogTraceListener(string source, IMsgFormatter formatter) : base(new EventLogTraceListener(source), formatter) { }
/// <summary> /// Initializes a new instance of <see cref="FormattedEventLogTraceListener"/> with an /// <see cref="IMsgFormatter"/> and a <see cref="EventLogTraceListener"/> /// </summary> /// <param name="source">The source name for the wrapped listener.</param> /// <param name="log">The name of the event log.</param> /// <param name="machineName">The machine name for the event log.</param> /// <param name="formatter">The formatter for the wrapper.</param> public FormattedEventLogTraceListener(string source, string log, string machineName, IMsgFormatter formatter) : base(new EventLogTraceListener(new EventLog(log, NormalizeMachineName(machineName), source)), formatter) { }
/// <summary> /// Initializes a <see cref="EmailMessage"/> with the raw data to create and email, the MsgEntry, and the formatter /// </summary> /// <param name="toAddress">A semicolon delimited string the represents to whom the email should be sent.</param> /// <param name="fromAddress">Represents from whom the email is sent.</param> /// <param name="subjectLineStarter">Starting text for the subject line.</param> /// <param name="subjectLineEnder">Ending text for the subject line.</param> /// <param name="smtpServer">The name of the SMTP server.</param> /// <param name="smtpPort">The port on the SMTP server to use for sending the email.</param> /// <param name="MsgEntry">The MsgEntry <see cref="MsgEntry"/> to send via email.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> public EmailMessage(string toAddress, string fromAddress, string subjectLineStarter, string subjectLineEnder, string smtpServer, int smtpPort, MsgEntry MsgEntry, IMsgFormatter formatter) { this.configurationData = new EmailTraceListenerData(toAddress, fromAddress, subjectLineStarter, subjectLineEnder, smtpServer, smtpPort, string.Empty); this.MsgEntry = MsgEntry; this.formatter = formatter; }
/// <summary> /// Initializes a <see cref="EmailMessage"/> with the raw data to create and email, the MsgEntry, and the formatter /// </summary> /// <param name="toAddress">A semicolon delimited string the represents to whom the email should be sent.</param> /// <param name="fromAddress">Represents from whom the email is sent.</param> /// <param name="subjectLineStarter">Starting text for the subject line.</param> /// <param name="subjectLineEnder">Ending text for the subject line.</param> /// <param name="smtpServer">The name of the SMTP server.</param> /// <param name="smtpPort">The port on the SMTP server to use for sending the email.</param> /// <param name="MsgEntry">The MsgEntry <see cref="MsgEntry"/> to send via email.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> /// <param name="authenticationMode">Authenticate mode to use when connecting to SMTP server.</param> /// <param name="userName">User name to send to SMTP server if using username/password authentication.</param> /// <param name="password">Password to send to SMTP server if using username/password authentication.</param> /// <param name="useSSL">Use SSL to connect to STMP server - if true, yes, if false, no.</param> public EmailMessage(string toAddress, string fromAddress, string subjectLineStarter, string subjectLineEnder, string smtpServer, int smtpPort, MsgEntry MsgEntry, IMsgFormatter formatter, EmailAuthenticationMode authenticationMode, string userName, string password, bool useSSL) { this.configurationData = new EmailTraceListenerData(toAddress, fromAddress, subjectLineStarter, subjectLineEnder, smtpServer, smtpPort, string.Empty) { AuthenticationMode = authenticationMode, UserName = userName, Password = password, UseSSL = useSSL }; this.MsgEntry = MsgEntry; this.formatter = formatter; }
/// <summary> /// Initializes a <see cref="EmailMessage"/> with email configuration data, MsgEntry, and formatter /// </summary> /// <param name="configurationData">The configuration data <see cref="EmailTraceListenerData"/> /// that represents how to create the email message</param> /// <param name="MsgEntry">The MsgEntry <see cref="MsgEntry"/> to send via email.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> public EmailMessage(EmailTraceListenerData configurationData, MsgEntry MsgEntry, IMsgFormatter formatter) { this.configurationData = configurationData; this.MsgEntry = MsgEntry; this.formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="FormattedEventLogTraceListener"/> with an /// <see cref="IMsgFormatter"/> and a <see cref="EventLogTraceListener"/> /// initialized with <see cref="EventLog"/>. /// </summary> /// <param name="eventLog">The event log for the wrapped listener.</param> /// <param name="formatter">The formatter for the wrapper.</param> public FormattedEventLogTraceListener(EventLog eventLog, IMsgFormatter formatter) : base(new EventLogTraceListener(eventLog), formatter) { }
/// <summary> /// Initializes a new instance of <see cref="FormattedEventLogTraceListener"/> with an /// <see cref="IMsgFormatter"/> and a default <see cref="EventLogTraceListener"/>. /// </summary> /// <param name="formater">The formatter for the wrapper.</param> public FormattedEventLogTraceListener(IMsgFormatter formater) : base(new EventLogTraceListener(), formater) { }
/// <summary> /// Initializes a new instance of <see cref="EmailTraceListener"/> with a toaddress, fromaddress, /// subjectlinestarter, subjectlinender, smtpserver, and a formatter /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="toAddress">A semicolon delimited string the represents to whom the email should be sent.</param> /// <param name="fromAddress">Represents from whom the email is sent.</param> /// <param name="subjectLineStarter">Starting text for the subject line.</param> /// <param name="subjectLineEnder">Ending text for the subject line.</param> /// <param name="smtpServer">The name of the SMTP server.</param> /// <param name="formatter">The Formatter <see cref="IMsgFormatter"/> which determines how the /// email message should be formatted</param> public EmailTraceListener(string toAddress, string fromAddress, string subjectLineStarter, string subjectLineEnder, string smtpServer, IMsgFormatter formatter) : this(toAddress, fromAddress, subjectLineStarter, subjectLineEnder, smtpServer, 25, formatter) { }
/// <summary> /// Initializes a new named instance of <see cref="FormattedTextWriterTraceListener"/> with a /// <see cref="IMsgFormatter"/> and a file name. /// </summary> /// <param name="fileName">The file name to write to.</param> /// <param name="name">The name.</param> /// <param name="formatter">The formatter to format the messages.</param> public FormattedTextWriterTraceListener(string fileName, string name, IMsgFormatter formatter) : this(fileName, name) { this.Formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="FlatFileTraceListener"/> with a file name, a header, a footer and /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="fileName">The file stream.</param> /// <param name="header">The header.</param> /// <param name="footer">The footer.</param> /// <param name="formatter">The formatter.</param> public FlatFileTraceListener(string fileName, string header, string footer, IMsgFormatter formatter) : base(EnvironmentHelper.ReplaceEnvironmentVariables(fileName), formatter) { this.header = header; this.footer = footer; }
/// <summary> /// Initializes a new instance of <see cref="FormattedEventLogTraceListener"/> with an /// <see cref="IMsgFormatter"/> and a <see cref="EventLogTraceListener"/> /// initialized with source name. /// </summary> /// <param name="source">The source name for the wrapped listener.</param> /// <param name="log">The name of the event log.</param> /// <param name="formatter">The formatter for the wrapper.</param> public FormattedEventLogTraceListener(string source, string log, IMsgFormatter formatter) : base(new EventLogTraceListener(new EventLog(log, DefaultMachineName, source)), formatter) { }
/// <summary> /// Initializes a new named instance of <see cref="FormattedTextWriterTraceListener"/> with a /// <see cref="IMsgFormatter"/> and a <see cref="TextWriter"/>. /// </summary> /// <param name="writer">The writer to write to.</param> /// <param name="name">The name.</param> /// <param name="formatter">The formatter to format the messages.</param> public FormattedTextWriterTraceListener(TextWriter writer, string name, IMsgFormatter formatter) : this(writer, name) { this.Formatter = formatter; }
/// <summary> /// Initializes a new named instance of <see cref="FlatFileTraceListener"/> with a file name and /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="fileName">The file name.</param> /// <param name="name">The name.</param> /// <param name="formatter">The formatter.</param> public FlatFileTraceListener(string fileName, string name, IMsgFormatter formatter) : base(EnvironmentHelper.ReplaceEnvironmentVariables(fileName), name, formatter) { }
/// <summary> /// Initializes a new instance of <see cref="FormattedTextWriterTraceListener"/> with a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="formatter">The formatter to format the messages.</param> public FormattedTextWriterTraceListener(IMsgFormatter formatter) { this.Formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="FlatFileTraceListener"/> with a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="formatter">The formatter.</param> public FlatFileTraceListener(IMsgFormatter formatter) : base(formatter) { }
/// <summary> /// Initializes a new instance of <see cref="FormattedTextWriterTraceListener"/> with a /// <see cref="IMsgFormatter"/> and a <see cref="TextWriter"/>. /// </summary> /// <param name="writer">The writer to write to.</param> /// <param name="formatter">The formatter to format the messages.</param> public FormattedTextWriterTraceListener(TextWriter writer, IMsgFormatter formatter) : this(writer) { this.Formatter = formatter; }
/// <summary> /// Initializes a new instance of <see cref="FlatFileTraceListener"/> with a <see cref="FileStream"/> and /// a <see cref="IMsgFormatter"/>. /// </summary> /// <param name="stream">The file stream writen to.</param> /// <param name="formatter">The formatter.</param> public FlatFileTraceListener(FileStream stream, IMsgFormatter formatter) : base(stream, formatter) { }