Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in a json logger as an extra #4

Closed
maraisr opened this issue Jan 18, 2021 · 0 comments · Fixed by #8
Closed

Add in a json logger as an extra #4

maraisr opened this issue Jan 18, 2021 · 0 comments · Fixed by #8

Comments

@maraisr
Copy link
Owner

maraisr commented Jan 18, 2021

I have found myself wanting to consume logs in a server runtime as json. This helps me consume/query/filter logs in a far easier manner, than parsing the messages.

To do this, and w/o forcing this on users I will expose a new entrypoint diary/middleware .

The idea being, that here we'll the suite of hooks?? (might not) as well as a collection of "baked-in" plugins, like json and maybe request logger. etc.

Maybe api:

import { json } from 'diary/middleware';
import { diary } from 'diary';

const logger = diary('');

json(); // will assume global
json(logger); // will just log as json for `logger`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant