Helper functions required for logging
Methods
(static) getLogBlackList(pathsToSkipLogging) → {Array}
Make an array of strings out of a string that holds a comma-selarated list of URIs.
Parameters:
Name | Type | Description |
---|---|---|
pathsToSkipLogging |
String | The string that contains the comma-separated list of URIs that should not be logged. |
Returns:
- The array of URI strings
- Type
- Array
(static) ignoreRouteLogging(container, req, res) → {Boolean}
Tells if the path of the given request is on the blacklist, so it should be ignored for logging
It is a curried function, that first gets the container object, that holds the blacklist in the configuration.
It returns a function that the winston logger can use via its ignoreRoute
feature.
Parameters:
Name | Type | Description |
---|---|---|
container |
Object | The container context |
req |
Object | The request object. The function uses only its |
res |
Object | The response object. Not used by this function. |
Returns:
Returns true
if the path matches any of the blaclisted patterns, false
otherwise.
- Type
- Boolean
(static) isPathBlackListed(container, path) → {Boolean}
Tells if the path is blacklisted
Parameters:
Name | Type | Description |
---|---|---|
container |
Object | The container context |
path |
String | The path to check if that matches any of the patterns listen on the blacklist |
Returns:
Returns true
if the path matches any of the blaclisted patterns, false
otherwise.
- Type
- Boolean