restify / restify/node-restify
Allow overriding log in `plugins/audit`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 975
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 5
Description
- [ x] Used appropriate template for the issue type
- [ x] Searched both open and closed issues for duplicates of this issue
- [ x] Title adequately and concisely reflects the feature or the bug
Feature Request
Use Case
So the change in 528ecbcec5d70c458749bdd4c4cc3f9e06ab69a2 means that whatever log I passed into auditLogger is not prioritised over the log from createServer.
I would imagine that whatever new log passed to auditLogger should take precedence.
Example API
const server = restify.createServer({ log: loggerA , ... });
server.on('after', restify.plugins.auditLogger({ log: loggerB, ... }));
I would expect loggerB would be used instead of loggerA.
Are you willing and able to implement this?
I can quickly do the fix, but not sure about the tests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in plugins/audit at auditLogger and trace how its options are combined with createServer's log. Confirm completion when the log passed to auditLogger is used instead of the server log in the shown API scenario, with focused test coverage for that precedence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100