Closed micahhausler closed 8 years ago
What about just including request.state
in the log? You could put your extra stuff in there and then you'd only need small change to good
to have them show up?
Thats what I ended up doing.
module.exports = {
type: "onPostAuth",
method: function(req, res){
req.log(["audit"], {user_id: req.session.user_id, ...});
res.continue();
}
};
and then I could filter on that log tag.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
I'd like to use Good to create an audit log on a service, but currently I can only add request parameters that are predefined and hard-coded and only the payload from the response.
What I'd like to have is a way to get custom user-defined parameters off the request object to inject into the log. It might look something like this on the
RequestSent
class's constructor method:That way, I could inject user and group information to each request, say in an extension
And then add the parameter names to my logging options
I'm not asking for a critique of this snippet's implementation, just if a patch with this type of logic would be accepted.