I have a node.js backend. I'm thinking on how should I set up logging. I want to just do it directly from the app itself, that gives great flexibility. But I've been hearing some opinions that I should log to stdout/stderr and handle logging outside the application. What are the reasons? Can't I just log from the app itself? I want to use loggly to store my logs, which involves sending json objects to its api and there are custom tags. If I wanted to log the info from stdout, I would have to log stringified json to the stdout, and then re-parse it outside the app in order to send it to loggly and apply proper labels/tags for the log. So that makes it much more complicated. So in that case, is it perfectly fine to just log from the app? Or are there better reasons to not do so?
via Maciej Krawczyk
No comments:
Post a Comment