Properly setting up a logging system for your application is essential for its maintainability, debugging and monitoring.
That being said, what we ideally want in a logging system is the following:
- Only log our application messages, don’t log symphony stuff;
- Log to a different file per environment (dev.log, test.log, prod.log);
- Log to the console, when we run the app through the command line. This way we see feedback immediately, we don’t need to have another window open with tail -f dev.log. With this we can also automate the feedback the app gives back tot he user;
- Also log specific jobs to a specific file, so we have a log per job;
- On Production it should also send us an email if something goes wrong.
Continue reading “How to set up a proper logger in Symfony2”