ministryofjustice / common-utils
Common code that is needed for all projects
Installs: 4 790
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 66
Forks: 2
Open Issues: 6
Requires
- php: >=7.1
- container-interop/container-interop: ^1.2
- psr/log: ^1.0
- qandidate/toggle: ^1.1
- symfony/debug: >=2.6.0, <4.0
- zendframework/zendframework: 2.*
Requires (Dev)
- mockery/mockery: 0.8.0
- phpstan/phpstan: ^0.8
- phpunit/phpunit: 3.7.*
- dev-master
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.9
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.0
- dev-log-all-exceptions
- dev-SW-878-dont-log-error-responses
- dev-DAPH-94-add-cache-warmup
- dev-OPGOPS-2068
- dev-SDV-2-29
- dev-e2e-logging-controller-test
This package is not auto-updated.
Last update: 2022-03-17 03:52:00 UTC
README
A Zend Framework 2 module which currently does logging. The idea with this was to perhaps create a shared library that was needed across front-end,back-end,membrane. The requirements for the logger will built from this ticket in JIRA: https://opgtransform.atlassian.net/browse/SDV-309. Any update to this library means that you need to run composer for all three repos to update the logging for it.
There is a sample configuration file for the logger contained in this repo logger.global.php needs to be in the repo where you want logging. An example is here
'extractions' => array(0 => array('property' => 'response',
'method_name' => 'getStatusCode',
'method_values' => 'status_code'),
1 => array('property' => 'request',
'method_name' => 'getServer',
'method_values' => array(
'QUERY_STRING','SERVER_NAME','HTTP_HOST','REQUEST_METHOD',
'REQUEST_URI','QUERY_STRING','CONTENT_TYPE','CONTENT_LENGTH',
'REMOTE_ADDR','REMOTE_PORT','SERVER_ADDR','HTTPS','APP_ENV',
'HTTP_HOST','HTTP_USER_AGENT','HTTP_X_USER_ID','HTTP_CONTENT_TYPE')),
),
The logger is configurable. There is a Extractor Class which has the request and response objects set on it. The configurations then can extract variables based on configuration.
property: Is either response or request.
method_name : the method to call on the property.
method_values : the method value to pass to the method.