RestApiRequestLoggerService

package

Default

Methods

__construct

__construct(\Shopware_Components_Auth $auth, \Enlight_Components_Db_Adapter_Pdo_Mysql $db, \Shopware\Components\Model\ModelManager $entityManager, \Enlight_Event_EventManager $eventManager) 

Arguments

$auth

\Shopware_Components_Auth

$db

\Enlight_Components_Db_Adapter_Pdo_Mysql

$entityManager

\Shopware\Components\Model\ModelManager

$eventManager

\Enlight_Event_EventManager

getCurrentLogEntry

getCurrentLogEntry(\Enlight_Controller_Request_RequestHttp $request) : \Shopware\CustomModels\ViisonPickwareERP\RestApi\RestApiRequest|null

Arguments

$request

\Enlight_Controller_Request_RequestHttp

Response

\Shopware\CustomModels\ViisonPickwareERP\RestApi\RestApiRequest|null

Returns the extimated size of the 'pickware_erp_rest_api_requests' table on disk.

getLogSize() : string

Response

string

Creates a new log entity containing the data of the given request plus the request headers and IP address of the requesting machine. Finally the created log entry is added to the request attributes for later use.

logRequest(\Enlight_Controller_Request_RequestHttp $request) 

Arguments

$request

\Enlight_Controller_Request_RequestHttp

Adds information about the given response to the log that is being handles by this logger and saves the changes in the database.

logResponse(\Enlight_Controller_Request_RequestHttp $request, \Enlight_Controller_Response_ResponseHttp $response) 

Arguments

$request

\Enlight_Controller_Request_RequestHttp

$response

\Enlight_Controller_Response_ResponseHttp

Deletes all log entries from the database, which are older than 10 days, as well as all idempotent operations that are not associated to any remaining log entry.

truncateLog() 

Constants

A key used for saving the ID of the created log entry in a request object.

ID

A key used for saving the time of the log entry creation in a request object.

TIMESTAMP

A key used for overwriting the max depth of the logged response JSON.

DEPTH

The name of a 'filter' event, which is fired before logging a request.

REQUEST

The name of a 'filter' event, which is fired before logging a response JSON.

JSON

The number of requests between two automatic log clean ups.

INTERVAL