Click here to Skip to main content
15,891,253 members
Articles / Web Development / ASP.NET

Port Writer Trace Listener for .NET Applications

Rate me:
Please Sign up or sign in to vote.
4.60/5 (11 votes)
12 Aug 2007CPOL11 min read 66.2K   1.6K   55  
A Trace Listener class writing Trace Messages to a UDP port. Also provided is a WinForm application called TraceView to view the Trace Messages sent by the Trace Listener.
namespace PerformanceSolutions.WinForms
{
    partial class FilterDlg
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.lblField = new System.Windows.Forms.Label();
            this.cboField = new System.Windows.Forms.ComboBox();
            this.lblKeyword = new System.Windows.Forms.Label();
            this.txtKeyword = new System.Windows.Forms.TextBox();
            this.grpEventType = new System.Windows.Forms.GroupBox();
            this.chkAspDotNet = new System.Windows.Forms.CheckBox();
            this.chkWarning = new System.Windows.Forms.CheckBox();
            this.chkInformation = new System.Windows.Forms.CheckBox();
            this.chkError = new System.Windows.Forms.CheckBox();
            this.chkCritical = new System.Windows.Forms.CheckBox();
            this.label1 = new System.Windows.Forms.Label();
            this.btnOK = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.grpEventType.SuspendLayout();
            this.SuspendLayout();
            // 
            // lblField
            // 
            this.lblField.AutoSize = true;
            this.lblField.Location = new System.Drawing.Point(21, 27);
            this.lblField.Name = "lblField";
            this.lblField.Size = new System.Drawing.Size(32, 13);
            this.lblField.TabIndex = 0;
            this.lblField.Text = "Field:";
            // 
            // cboField
            // 
            this.cboField.FormattingEnabled = true;
            this.cboField.Items.AddRange(new object[] {
            "Callstack",
            "Datetime",
            "LogicalOperationStack",
            "Message",
            "Message Id",
            "Message Source",
            "Process Id",
            "Thread Id"});
            this.cboField.Location = new System.Drawing.Point(78, 24);
            this.cboField.Name = "cboField";
            this.cboField.Size = new System.Drawing.Size(178, 21);
            this.cboField.Sorted = true;
            this.cboField.TabIndex = 1;
            this.cboField.Text = "Message";
            // 
            // lblKeyword
            // 
            this.lblKeyword.AutoSize = true;
            this.lblKeyword.Location = new System.Drawing.Point(21, 66);
            this.lblKeyword.Name = "lblKeyword";
            this.lblKeyword.Size = new System.Drawing.Size(51, 13);
            this.lblKeyword.TabIndex = 2;
            this.lblKeyword.Text = "Keyword:";
            // 
            // txtKeyword
            // 
            this.txtKeyword.Location = new System.Drawing.Point(78, 63);
            this.txtKeyword.Name = "txtKeyword";
            this.txtKeyword.Size = new System.Drawing.Size(178, 20);
            this.txtKeyword.TabIndex = 3;
            // 
            // grpEventType
            // 
            this.grpEventType.Controls.Add(this.chkAspDotNet);
            this.grpEventType.Controls.Add(this.chkWarning);
            this.grpEventType.Controls.Add(this.chkInformation);
            this.grpEventType.Controls.Add(this.chkError);
            this.grpEventType.Controls.Add(this.chkCritical);
            this.grpEventType.Location = new System.Drawing.Point(24, 129);
            this.grpEventType.Name = "grpEventType";
            this.grpEventType.Size = new System.Drawing.Size(232, 133);
            this.grpEventType.TabIndex = 4;
            this.grpEventType.TabStop = false;
            this.grpEventType.Text = "Event Type";
            // 
            // chkAspDotNet
            // 
            this.chkAspDotNet.AutoSize = true;
            this.chkAspDotNet.Location = new System.Drawing.Point(16, 100);
            this.chkAspDotNet.Name = "chkAspDotNet";
            this.chkAspDotNet.Size = new System.Drawing.Size(80, 17);
            this.chkAspDotNet.TabIndex = 4;
            this.chkAspDotNet.Text = "Do not filter";
            this.chkAspDotNet.UseVisualStyleBackColor = true;
            this.chkAspDotNet.CheckedChanged += new System.EventHandler(this.chkAspDotNet_CheckedChanged);
            // 
            // chkWarning
            // 
            this.chkWarning.AutoSize = true;
            this.chkWarning.Location = new System.Drawing.Point(157, 68);
            this.chkWarning.Name = "chkWarning";
            this.chkWarning.Size = new System.Drawing.Size(66, 17);
            this.chkWarning.TabIndex = 3;
            this.chkWarning.Text = "Warning";
            this.chkWarning.UseVisualStyleBackColor = true;
            // 
            // chkInformation
            // 
            this.chkInformation.AutoSize = true;
            this.chkInformation.Location = new System.Drawing.Point(16, 68);
            this.chkInformation.Name = "chkInformation";
            this.chkInformation.Size = new System.Drawing.Size(78, 17);
            this.chkInformation.TabIndex = 2;
            this.chkInformation.Text = "Information";
            this.chkInformation.UseVisualStyleBackColor = true;
            // 
            // chkError
            // 
            this.chkError.AutoSize = true;
            this.chkError.Location = new System.Drawing.Point(155, 28);
            this.chkError.Name = "chkError";
            this.chkError.Size = new System.Drawing.Size(48, 17);
            this.chkError.TabIndex = 1;
            this.chkError.Text = "Error";
            this.chkError.UseVisualStyleBackColor = true;
            // 
            // chkCritical
            // 
            this.chkCritical.AutoSize = true;
            this.chkCritical.Location = new System.Drawing.Point(16, 28);
            this.chkCritical.Name = "chkCritical";
            this.chkCritical.Size = new System.Drawing.Size(57, 17);
            this.chkCritical.TabIndex = 0;
            this.chkCritical.Text = "Critical";
            this.chkCritical.UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(75, 97);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(184, 13);
            this.label1.TabIndex = 5;
            this.label1.Text = "Please enter keywords seperated by ;";
            // 
            // btnOK
            // 
            this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnOK.Location = new System.Drawing.Point(43, 268);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new System.Drawing.Size(75, 23);
            this.btnOK.TabIndex = 6;
            this.btnOK.Text = "&OK";
            this.btnOK.UseVisualStyleBackColor = true;
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            // 
            // btnCancel
            // 
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(152, 268);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(75, 23);
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "&Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            // 
            // FilterDlg
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.btnCancel;
            this.ClientSize = new System.Drawing.Size(291, 303);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.grpEventType);
            this.Controls.Add(this.txtKeyword);
            this.Controls.Add(this.lblKeyword);
            this.Controls.Add(this.cboField);
            this.Controls.Add(this.lblField);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FilterDlg";
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Select Filter ...";
            this.Load += new System.EventHandler(this.FilterDlg_Load);
            this.grpEventType.ResumeLayout(false);
            this.grpEventType.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label lblField;
        private System.Windows.Forms.ComboBox cboField;
        private System.Windows.Forms.Label lblKeyword;
        private System.Windows.Forms.TextBox txtKeyword;
        private System.Windows.Forms.GroupBox grpEventType;
        private System.Windows.Forms.CheckBox chkCritical;
        private System.Windows.Forms.CheckBox chkWarning;
        private System.Windows.Forms.CheckBox chkInformation;
        private System.Windows.Forms.CheckBox chkError;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnOK;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.CheckBox chkAspDotNet;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions