Log4net Log Output Type enumeration

Source: Internet
Author: User
Tags smtpclient log4net

Udpappender
... {
This. Remoteendpoint = new IPEndPoint (this. Remoteaddress, this. RemotePort);
if (this. LocalPort = 0)
... {
This. Client = new UdpClient ();
}
Else
... {
This. Client = new UdpClient (this. LocalPort);
}

Byte [] buffer = m_encoding. GetBytes (Renderloggingevent (loggingevent). ToCharArray ());
This. Client.send (buffer, buffer. Length, this. Remoteendpoint);

}

Smtppickupdirappender
... {
string filePath = null;
StreamWriter writer = null;

Impersonate to open the file
Using (Securitycontext.impersonate (this))
... {
FilePath = Path.Combine (M_pickupdir, Systeminfo.newguid (). ToString ("N"));
writer = File.createtext (FilePath);
}
using (writer)
... {
Writer. WriteLine ("to:" + m_to);
Writer. WriteLine ("From:" + m_from);
Writer. WriteLine ("Subject:" + m_subject);
Writer. WriteLine ("");
}
}
Eventlogappender
... {
EventLog.DeleteEventSource (M_applicationname, m_machinename);
EventLog.CreateEventSource (source, LogName, MachineName);
Registeredlogname = Eventlog.lognamefromsourcename (M_applicationname, m_machinename);
EventLog.WriteEntry (M_applicationname, Eventtxt, EntryType, EventID);
}

Smtpappender
... {
#if net_2_0
. NET 2.0 has a new API for SMTP email System.Net.Mail
This API supports credentials and multiple hosts correctly.
The old API is deprecated.

Create and configure the SMTP client
SmtpClient smtpclient = new SmtpClient ();
if (m_smtphost!= null && m_smtphost.length > 0)
... {
Smtpclient.host = M_smtphost;
}
Smtpclient.port = M_port;
Smtpclient.deliverymethod = Smtpdeliverymethod.network;

if (m_authentication = = Smtpauthentication.basic)
... {
Perform Basic authentication
Smtpclient.credentials =

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.