Regardless of programming language, framework, environment or target device, the concept of Logging is important for anyone doing any kind of development. When you're working with a complex system like concrete5, you may not always be able to simply print out explanatory information to a screen; perhaps you want to peek into a process buried deep in a command line or AJAX call. In these cases and more, it's critical to have access to a logging system. In concrete5, the built-in logging can be used for:
- Development logging: saving values or states while creating custom code, so they can later be consulted to determine why something is or isn't working.
- Auditive logging: saving things like email messages sent by the system, or noting when pages are deleted.
- Error logging: if something goes seriously wrong in concrete5, it will automatically be logged.
You can get at these log entries from the Dashboard > Reports > Logs screen:
While error logging and email logging happen automatically in the core, logging is only as useful as the code that implements it. If you create add-ons or custom code for concrete5, you should consider adding logging functionality to it; you never know when you might want need to see when something occurred. Additionally, concrete5's logging provides flexible support for channels and logging levels, making it possible to do different things with log entries, based on their severity, or which channel they were logged to.