ServerLogger Class

A class used to add messages to the server's log.


Constructors

NameDescription
ServerLoggerCreates 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.

ConstantValueDescription
ServerLogger.msgType.error1Error level.
ServerLogger.msgType.warning2Warning level.
ServerLogger.msgType.infoSimple3Simple info level.
ServerLogger.msgType.infoStandard4Standard info level.
ServerLogger.msgType.infoDetailed5Detailed info level.
ServerLogger.msgType.debug100Debug level. Everything is logged.

Methods

NameDescription
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.

Use dark colors for code blocksCopy
1
2
3
4
public void LogMessage(ServerLogger.msgType msgType,
    string methodName,
    int msgCode,
    string msg)
ParameterDescription
msgTypeThe log level for the message.
methodNameThe name of the method writing this message.
msgCodeA unique identifier for the message.
msgThe message to be written to the log.

ServerLogger.LogMessage(msgType, String, Int32, Double, String) Method

Logs a message.

Use dark colors for code blocksCopy
1
2
3
4
5
public void LogMessage(ServerLogger.msgType msgType,
    string methodName,
    int msgCode,
    double elapsed,
    string msg)
ParameterDescription
msgTypeThe log level for the message.
methodNameThe name of the method writing this message.
msgCodeA unique identifier for the message.
elapsedThe number of seconds elapsed.
msgThe message to be written to the log.

ServerLogger.LogRequest(String, String) Method

Logs the fact that a request has been received.

Use dark colors for code blocksCopy
1
public void LogRequest(string methodName, string request)
ParameterDescription
methodNameThe name of the method being invoked.
requestThe 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.

Use dark colors for code blocksCopy
1
public void LogResponse(string methodName, string response, double elapsed)
ParameterDescription
methodNameThe name of the method.
responseThe actual response. Its size will be logged.
elapsedThe 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.

Use dark colors for code blocksCopy
1
public void LogResponse(string methodName, byte[] response, double elapsed)
ParameterDescription
methodNameThe name of the method writing this message.
responseThe actual response. Its size will be logged.
elapsedThe number of seconds elapsed.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.