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 logging library #25

Open
falun opened this issue Jan 4, 2017 · 4 comments
Open

Add logging library #25

falun opened this issue Jan 4, 2017 · 4 comments

Comments

@falun
Copy link
Collaborator

falun commented Jan 4, 2017

echo just doesn't cut it any more.

Need to add a logging library and make it configurable. The problem here is finding a good balance between simplicity (of use & config) and flexibility.

This should include updating docs/Production.md or linking from it to a doc describing logging solution.

@dustball
Copy link
Owner

dustball commented Jan 4, 2017 via email

@falun
Copy link
Collaborator Author

falun commented Jan 4, 2017

logging error output (stack traces and such) that we don't want to push back to clients but would be nice to have for debugging.

We would hook into www/api-logging.php.

In fancy-fancy land we could also do stuff like hooking to external log/error aggregation services via RPC or message queue (since it seems lame to block our API on a disk write on error)

@dustball
Copy link
Owner

dustball commented Jan 4, 2017 via email

@falun
Copy link
Collaborator Author

falun commented Jan 4, 2017

In general I want to avoid the client so even on dev I was imagining not printing to stdout so as to not break the "don't output content before header calls" rule.

I have no objection to syslog as a destination or doing a simple but relatively rigid system initially. The only thing I'd really like is to have an easy way to switch to a psr-3 compatible logger in the future if we need. That could be trivially accomplished by just having all our log functions in a single place instead of doing some kind of:

if ($prod) {
   prod_log(...);
} else {
    dev_log(...);
}

pattern everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants