
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@restorecommerce/koa-req-res-logger
Advanced tools
Koa 2 middleware which logs incoming requests and outgoing responses
A GraphQL aware request/ response logger for Koa 2.
The logger accepts an option logger which must be a winston compatible logger.
If not provided, winston is used.
The generated log data has the following structure:
// **Request** log structure
interface Request {
method: string; // HTTP request method
url: string; // requested URL
header: object; // HTTP request headers
graphql?: { // If request is a GraphQL request and is enabled in options
operationName?: string; // GraphQL operation name if exists
query?: string; // GraphQL query if exists
variables?: object; // GraphQL variables if exist and is enabled in options
}
}
// **Response** log structure
interface Response {
procTime: number; // processing time for of the middleware stack
status: number; // HTTP status code
header: object; // HTTP headers
graphql?: { // If request is a GraphQL request and is enabled in options
operationName?: string; // GraphQL operation name if exists
query?: string; // GraphQL query if exists
variables?: object; // GraphQL variables if exist and is enabled in options
}
}
The GraphQL request data will be only included in one of the logs. Logging GraphQL data requires that the body of this request has been read. If the body has not been read when it reaches the request log, it will be logged in the response.
see test.js.
logger Winston compatible logger like Restore Logger.logResBody [false] Whether the response body should be logged or not.logGraphQL [false] Whether graphql-specific data should be logged or not.logGraphQLVariables [false] Whether graphql request variables should be logged or not.FAQs
Koa 2 middleware which logs incoming requests and outgoing responses
The npm package @restorecommerce/koa-req-res-logger receives a total of 71 weekly downloads. As such, @restorecommerce/koa-req-res-logger popularity was classified as not popular.
We found that @restorecommerce/koa-req-res-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies