-
Notifications
You must be signed in to change notification settings - Fork 18
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
re-enable logging #10
Comments
would it be possible to write logs to a db, and have some sort of cron job that deletes from the table at some time period? This is under the assumption that we don't need to be saving every single log. Or mabye log to a file first, then batch send it to a db at some point later in time? |
@maxnawa31 yup for sure, originally it would write to a file and then occasionally just make a new file, but the file i/o operations were taking up a ton of cpu. i'm fine with adding a persistence layer, i just don't want to spend a bunch of money on it. |
could we maybe remove the file altogether, and instead write to an in-memory store (i.e. Redis) and then at some point write to the database? I suppose this would follow a 'Write-Back' protocol |
yeah i'd be super down to explore this option @maxnawa31 |
@Nalipp I think this is a promising direction: https://www.npmjs.com/package/winston |
there's a function that used to be part of the project which would log every request (
numbers_api/routes/api.js
Line 24 in 5f03fff
However, the logging was consuming >100% CPU, mostly likely because the files were getting quite large and so reading / writing was expensive. Would be nice to bring this feature back, but we should think about how to better support it at current scale. (Redis? DB? something else?)
The text was updated successfully, but these errors were encountered: