The PEP-Proxy currently uses log4js for its debug logging, this is problematic because it is the only common FIWARE component to do so and the configuration file lies within the Dockerized source code container making it difficult to change the settings when diagnosing issues.
This PR replaces log4js with debug and morgan which is a much more widely used combination within Express Apps and aligns with the current logging combination within Keyrock.
Debug is controlled by two ENV parameters
set DEBUG=*,-not_this npm start
Uses standard debug filtering using wild-cards - all PEP-Proxy messages use the prefix pep-proxy
set PEP_PROXY_DEBUG=true
decides whether to log incoming requests (in the same fashion as IDM_DEBUG on Keyrock.
Types of changes
What types of changes does your code introduce to the project: Put an x in the boxes that apply
[ ] Bugfix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.
[x] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you
did and what alternatives you considered, etc...
Proposed changes
The PEP-Proxy currently uses log4js for its debug logging, this is problematic because it is the only common FIWARE component to do so and the configuration file lies within the Dockerized source code container making it difficult to change the settings when diagnosing issues.
This PR replaces
log4js
with debug and morgan which is a much more widely used combination within Express Apps and aligns with the current logging combination within Keyrock.Debug is controlled by two ENV parameters
Uses standard
debug
filtering using wild-cards - all PEP-Proxy messages use the prefixpep-proxy
decides whether to log incoming requests (in the same fashion as
IDM_DEBUG
on Keyrock.Types of changes
What types of changes does your code introduce to the project: Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...