A class used to add messages to the server's log.
Constructors
Name | Description |
---|---|
ServerLogger | Creates a new instance of the logger. |
ServerLogger Constructor
Creates a new instance of the logger.
ServerLogger.msgType Constants
The log level for a log message.
Constant | Value | Description |
---|---|---|
ServerLogger.msgType.error | 1 | Error level. |
ServerLogger.msgType.warning | 2 | Warning level. |
ServerLogger.msgType.infoSimple | 3 | Simple info level. |
ServerLogger.msgType.infoStandard | 4 | Standard info level. |
ServerLogger.msgType.infoDetailed | 5 | Detailed info level. |
ServerLogger.msgType.debug | 100 | Debug level. Everything is logged. |
Methods
Name | Description |
---|---|
ServerLogger.LogMessage(msgType, String, Int32, String) | Logs a message. |
ServerLogger.LogMessage(msgType, String, Int32, Double, String) | Logs a message. |
ServerLogger.LogRequest(String, String) | Logs the fact that a request has been received. |
ServerLogger.LogResponse(String, String, Double) | Logs the fact that a response is being sent back to the client. |
ServerLogger.LogResponse(String, Byte[], Double) | Logs the fact that a response is being sent back to the client. |
ServerLogger.LogMessage(msgType, String, Int32, String) Method
Logs a message.
public void LogMessage(ServerLogger.msgType msgType,
string methodName,
int msgCode,
string msg)
Parameter | Description |
---|---|
msgType | The log level for the message. |
methodName | The name of the method writing this message. |
msgCode | A unique identifier for the message. |
msg | The message to be written to the log. |
ServerLogger.LogMessage(msgType, String, Int32, Double, String) Method
Logs a message.
public void LogMessage(ServerLogger.msgType msgType,
string methodName,
int msgCode,
double elapsed,
string msg)
Parameter | Description |
---|---|
msgType | The log level for the message. |
methodName | The name of the method writing this message. |
msgCode | A unique identifier for the message. |
elapsed | The number of seconds elapsed. |
msg | The message to be written to the log. |
ServerLogger.LogRequest(String, String) Method
Logs the fact that a request has been received.
public void LogRequest(string methodName, string request)
Parameter | Description |
---|---|
methodName | The name of the method being invoked. |
request | The actual request. Its size will be logged. |
ServerLogger.LogResponse(String, String, Double) Method
Logs the fact that a response is being sent back to the client.
public void LogResponse(string methodName, string response, double elapsed)
Parameter | Description |
---|---|
methodName | The name of the method. |
response | The actual response. Its size will be logged. |
elapsed | The number of seconds it took to execute the method. |
ServerLogger.LogResponse(String, Byte[], Double) Method
Logs the fact that a response is being sent back to the client.
public void LogResponse(string methodName, byte[] response, double elapsed)
Parameter | Description |
---|---|
methodName | The name of the method writing this message. |
response | The actual response. Its size will be logged. |
elapsed | The number of seconds elapsed. |