Logger Class |
public class Logger : TraceListener
The Logger type exposes the following members.
Name | Description | |
---|---|---|
Error(String) | Log an error message. | |
Error(String, Int32) | Log an error message, including an errno error string. | |
Note | Log a notification message. | |
Warning | Log a warning message. | |
Write | Trace interface method for posting a message. | |
WriteLine | Trace interface method for posting a message. |
Name | Description | |
---|---|---|
LOG_ALERT | Alert condition message. | |
LOG_AUTH | Authentication facility. | |
LOG_CRIT | Critical condition message. | |
LOG_DAEMON | System daemon/background process facility. | |
LOG_DEBUG | Debug message. | |
LOG_EMERG | Emergency condition message. | |
LOG_ERR | Error message. | |
LOG_INFO | Informational message. | |
LOG_LOCAL0 | Locally defined facility. | |
LOG_LOCAL1 | Locally defined facility. | |
LOG_LOCAL2 | Locally defined facility. | |
LOG_LOCAL3 | Locally defined facility. | |
LOG_LOCAL4 | Locally defined facility. | |
LOG_LOCAL5 | Locally defined facility. | |
LOG_LOCAL6 | Locally defined facility. | |
LOG_LOCAL7 | Locally defined facility. | |
LOG_MAIL | Mail subsystem facility. | |
LOG_NDELAY | Open the connection to the syslog service immediately. Recommended. | |
LOG_NOTICE | Normal condition message. | |
LOG_ODELAY | Do not open the connection to the syslog service before logging the first message. Not recommended. | |
LOG_PERROR | Write message to both syslog service AND stderr. | |
LOG_PID | Prepend the caller's process ID to the message. | |
LOG_USER | User program facility. Use LOG_LOCALx instead. | |
LOG_WARNING | Warning message. |
var log = new IO.Objects.SimpleIO.syslog.Logger(); log.Note("Hello, Syslog!"); System.Diagnostics.Trace.Listeners.Clear(); System.Diagnostics.Trace.Listeners.Add(log); System.Diagnostics.Trace.Write("Hello, Trace!");