C# Class org.GraphDefined.Vanaheimr.Hermod.HTTP.HTTPLogger

A HTTP API logger.
Mostra file Open project: Vanaheimr/Hermod

Public Methods

Method Description
Debug ( String LogEventOrGroupName, LogTargets LogTarget ) : System.Boolean

Start debugging the given log event.

Default_LogHTTPRequest_toConsole ( String Context, String LogEventName, HTTPRequest Request ) : System.Threading.Tasks.Task

A default delegate for logging incoming HTTP requests to console.

Default_LogHTTPRequest_toDisc ( String Context, String LogEventName, HTTPRequest Request ) : System.Threading.Tasks.Task

A default delegate for logging incoming HTTP requests to disc.

Default_LogHTTPResponse_toConsole ( String Context, String LogEventName, HTTPRequest Request, HTTPResponse Response ) : System.Threading.Tasks.Task

A default delegate for logging HTTP requests/-responses to console.

Default_LogHTTPResponse_toDisc ( String Context, String LogEventName, HTTPRequest Request, HTTPResponse Response ) : System.Threading.Tasks.Task

A default delegate for logging HTTP requests/-responses to disc.

HTTPLogger ( HTTPServer HTTPAPI, String Context = "" ) : System

Create a new HTTP API logger using the default logging delegates.

HTTPLogger ( HTTPServer HTTPAPI, String Context, HTTPRequestLoggerDelegate LogHTTPRequest_toConsole, HTTPResponseLoggerDelegate LogHTTPResponse_toConsole, HTTPRequestLoggerDelegate LogHTTPRequest_toDisc, HTTPResponseLoggerDelegate LogHTTPResponse_toDisc, HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null, HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPError_toConsole = null, HTTPResponseLoggerDelegate LogHTTPError_toDisc = null, HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null, Func LogFileCreator = null ) : System

Create a new HTTP API logger using the given logging delegates.

HTTPLogger ( String Context, HTTPRequestLoggerDelegate LogHTTPRequest_toConsole, HTTPResponseLoggerDelegate LogHTTPResponse_toConsole, HTTPRequestLoggerDelegate LogHTTPRequest_toDisc, HTTPResponseLoggerDelegate LogHTTPResponse_toDisc, HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null, HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPError_toConsole = null, HTTPResponseLoggerDelegate LogHTTPError_toDisc = null, HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null, Func LogFileCreator = null ) : System

Create a new HTTP API logger using the given logging delegates.

Undebug ( String LogEventOrGroupName, LogTargets LogTarget ) : System.Boolean

Stop debugging the given log event.

Protected Methods

Method Description
HTTPLogger ( ) : System

Create a new HTTP API logger using the default logging delegates.

RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPClientRequestLogger

Register a log event for the linked HTTP API event.

RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPClientResponseLogger

Register a log event for the linked HTTP API event.

RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPServerRequestLogger

Register a log event for the linked HTTP API event.

RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPServerResponseLogger

Register a log event for the linked HTTP API event.

Private Methods

Method Description
InternalDebug ( String LogEventName, LogTargets LogTarget ) : System.Boolean
InternalUndebug ( String LogEventName, LogTargets LogTarget ) : System.Boolean
OpenFileWithRetry ( System.Action WorkToDo, System.TimeSpan Timeout = null ) : void

Method Details

Debug() public method

Start debugging the given log event.
public Debug ( String LogEventOrGroupName, LogTargets LogTarget ) : System.Boolean
LogEventOrGroupName String A log event of group name.
LogTarget LogTargets The log target.
return System.Boolean

Default_LogHTTPRequest_toConsole() public method

A default delegate for logging incoming HTTP requests to console.
public Default_LogHTTPRequest_toConsole ( String Context, String LogEventName, HTTPRequest Request ) : System.Threading.Tasks.Task
Context String The context of the log request.
LogEventName String The name of the log event.
Request HTTPRequest The HTTP request to log.
return System.Threading.Tasks.Task

Default_LogHTTPRequest_toDisc() public method

A default delegate for logging incoming HTTP requests to disc.
public Default_LogHTTPRequest_toDisc ( String Context, String LogEventName, HTTPRequest Request ) : System.Threading.Tasks.Task
Context String The context of the log request.
LogEventName String The name of the log event.
Request HTTPRequest The HTTP request to log.
return System.Threading.Tasks.Task

Default_LogHTTPResponse_toConsole() public method

A default delegate for logging HTTP requests/-responses to console.
public Default_LogHTTPResponse_toConsole ( String Context, String LogEventName, HTTPRequest Request, HTTPResponse Response ) : System.Threading.Tasks.Task
Context String The context of the log request.
LogEventName String The name of the log event.
Request HTTPRequest The HTTP request to log.
Response HTTPResponse The HTTP response to log.
return System.Threading.Tasks.Task

Default_LogHTTPResponse_toDisc() public method

A default delegate for logging HTTP requests/-responses to disc.
public Default_LogHTTPResponse_toDisc ( String Context, String LogEventName, HTTPRequest Request, HTTPResponse Response ) : System.Threading.Tasks.Task
Context String The context of the log request.
LogEventName String The name of the log event.
Request HTTPRequest The HTTP request to log.
Response HTTPResponse The HTTP response to log.
return System.Threading.Tasks.Task

HTTPLogger() protected method

Create a new HTTP API logger using the default logging delegates.
protected HTTPLogger ( ) : System
return System

HTTPLogger() public method

Create a new HTTP API logger using the default logging delegates.
public HTTPLogger ( HTTPServer HTTPAPI, String Context = "" ) : System
HTTPAPI HTTPServer A HTTP API.
Context String A context of this API.
return System

HTTPLogger() public method

Create a new HTTP API logger using the given logging delegates.
public HTTPLogger ( HTTPServer HTTPAPI, String Context, HTTPRequestLoggerDelegate LogHTTPRequest_toConsole, HTTPResponseLoggerDelegate LogHTTPResponse_toConsole, HTTPRequestLoggerDelegate LogHTTPRequest_toDisc, HTTPResponseLoggerDelegate LogHTTPResponse_toDisc, HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null, HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPError_toConsole = null, HTTPResponseLoggerDelegate LogHTTPError_toDisc = null, HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null, Func LogFileCreator = null ) : System
HTTPAPI HTTPServer A HTTP API.
Context String A context of this API.
LogHTTPRequest_toConsole HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to console.
LogHTTPResponse_toConsole HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to console.
LogHTTPRequest_toDisc HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to disc.
LogHTTPResponse_toDisc HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to disc.
LogHTTPRequest_toNetwork HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to a network target.
LogHTTPResponse_toNetwork HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to a network target.
LogHTTPRequest_toHTTPSSE HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to a HTTP server sent events source.
LogHTTPResponse_toHTTPSSE HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to a HTTP server sent events source.
LogHTTPError_toConsole HTTPResponseLoggerDelegate A delegate to log HTTP errors to console.
LogHTTPError_toDisc HTTPResponseLoggerDelegate A delegate to log HTTP errors to disc.
LogHTTPError_toNetwork HTTPResponseLoggerDelegate A delegate to log HTTP errors to a network target.
LogHTTPError_toHTTPSSE HTTPResponseLoggerDelegate A delegate to log HTTP errors to a HTTP server sent events source.
LogFileCreator Func A delegate to create a log file from the given context and log file name.
return System

HTTPLogger() public method

Create a new HTTP API logger using the given logging delegates.
public HTTPLogger ( String Context, HTTPRequestLoggerDelegate LogHTTPRequest_toConsole, HTTPResponseLoggerDelegate LogHTTPResponse_toConsole, HTTPRequestLoggerDelegate LogHTTPRequest_toDisc, HTTPResponseLoggerDelegate LogHTTPResponse_toDisc, HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null, HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null, HTTPResponseLoggerDelegate LogHTTPError_toConsole = null, HTTPResponseLoggerDelegate LogHTTPError_toDisc = null, HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null, HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null, Func LogFileCreator = null ) : System
Context String A context of this API.
LogHTTPRequest_toConsole HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to console.
LogHTTPResponse_toConsole HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to console.
LogHTTPRequest_toDisc HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to disc.
LogHTTPResponse_toDisc HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to disc.
LogHTTPRequest_toNetwork HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to a network target.
LogHTTPResponse_toNetwork HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to a network target.
LogHTTPRequest_toHTTPSSE HTTPRequestLoggerDelegate A delegate to log incoming HTTP requests to a HTTP server sent events source.
LogHTTPResponse_toHTTPSSE HTTPResponseLoggerDelegate A delegate to log HTTP requests/responses to a HTTP server sent events source.
LogHTTPError_toConsole HTTPResponseLoggerDelegate A delegate to log HTTP errors to console.
LogHTTPError_toDisc HTTPResponseLoggerDelegate A delegate to log HTTP errors to disc.
LogHTTPError_toNetwork HTTPResponseLoggerDelegate A delegate to log HTTP errors to a network target.
LogHTTPError_toHTTPSSE HTTPResponseLoggerDelegate A delegate to log HTTP errors to a HTTP server sent events source.
LogFileCreator Func A delegate to create a log file from the given context and log file name.
return System

RegisterEvent() protected method

Register a log event for the linked HTTP API event.
protected RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPClientRequestLogger
LogEventName String The name of the log event.
SubscribeToEventDelegate Action A delegate for subscribing to the linked event.
UnsubscribeFromEventDelegate Action A delegate for subscribing from the linked event.
return HTTPClientRequestLogger

RegisterEvent() protected method

Register a log event for the linked HTTP API event.
protected RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPClientResponseLogger
LogEventName String The name of the log event.
SubscribeToEventDelegate Action A delegate for subscribing to the linked event.
UnsubscribeFromEventDelegate Action A delegate for subscribing from the linked event.
return HTTPClientResponseLogger

RegisterEvent() protected method

Register a log event for the linked HTTP API event.
protected RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPServerRequestLogger
LogEventName String The name of the log event.
SubscribeToEventDelegate Action A delegate for subscribing to the linked event.
UnsubscribeFromEventDelegate Action A delegate for subscribing from the linked event.
return HTTPServerRequestLogger

RegisterEvent() protected method

Register a log event for the linked HTTP API event.
protected RegisterEvent ( String LogEventName, Action SubscribeToEventDelegate, Action UnsubscribeFromEventDelegate ) : HTTPServerResponseLogger
LogEventName String The name of the log event.
SubscribeToEventDelegate Action A delegate for subscribing to the linked event.
UnsubscribeFromEventDelegate Action A delegate for subscribing from the linked event.
return HTTPServerResponseLogger

Undebug() public method

Stop debugging the given log event.
public Undebug ( String LogEventOrGroupName, LogTargets LogTarget ) : System.Boolean
LogEventOrGroupName String A log event of group name.
LogTarget LogTargets The log target.
return System.Boolean