Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
sails-hook-apianalytics
Advanced tools
Readme
A Sails hook for logging detailed request metadata and monitoring your API.
This hook is for Sails v1 and up, and it also maintains backwards compatibility for Sails <=v0.12. But be aware that it provides much richer default logging for requests handled via actions2 (which is only available in Sails v1).
From your sails app:
$ npm install sails-hook-apianalytics --save
That's it! Next time you lift, and then send a request to the server, you should see stuff getting logged.
It will look something like this:
This hook works pretty well for most use cases out of the box.
Optionally, you can customize this hook in a few different ways by configuring sails.config.apianalytics
.
For instance, you might create config/apianalytics.js
:
// `config/apianalytics.js`
module.exports = {
apianalytics: {
/**
* An array of route addresses to monitor.
*
* (e.g. [ 'GET /foo/bar', 'POST /foo', 'all /admin/*' ])
*
* Defaults to logging all POST, PATCH, PUT, DELETE requests, and all
* GET requests except for those that appear to be for assets
* (i.e. using "GET r|^((?![^?]*\\/[^?\\/]+\\.[^?\\/]+(\\?.*)?).)*$|")
*/
routesToLog: [
// If you want to log everything- including requests for assets, use the following:
'/*'
],
/**
* Request parameters which should NEVER be logged.
* If seen, they will be replaced with "*REDACTED*"
*
* (e.g. "password")
*
* > WARNING:
* > This is a SHALLOW check of request body, querystring, and route path parameters.
* > Deeply nested properties with these names are not redacted.
*/
dontLogParams: [
'password',
'token'
]
}
};
If you have further questions or are having trouble, click here.
To report a bug, click here.
Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.
MIT © 2013-2016 Mike McNeil
As for the Sails framework, it's free and open-source under the MIT License too.
FAQs
Hook for advanced logging of API requests to a Sails.js server.
The npm package sails-hook-apianalytics receives a total of 1,742 weekly downloads. As such, sails-hook-apianalytics popularity was classified as popular.
We found that sails-hook-apianalytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.