The library comes with a log management system to be able to follow the operation and carry out the integration issues more easily, basically two log files are created.
These files are saved in a folder whose path is defined in the libcokeid.ini file, in the LOG_PATH value. By default, this value is set to /logs/default They will be at the same level as the cokeid library and the caché folder.
- gid-last-request.log: All the information is saved in this file by request. Its content is overwritten in each page request.
- gid-all-requests.log: All of the information will be saved in this file sequentially, with a limit of 10MB in 5 files.
IMPORTANT: the logs folder must not be in a public place accessible via URL, the same as the app configuration file. This folder must have write persmissions and its content must NOT be propagated when an upload to a test or production.
The log level of your application can be also configured in gid.ini file
1 2 3 4 5 6 7 8 9 10 11 12 |
; FATAL: shows messages at a FATAL level only ; ERROR: Shows messages classified as ERROR and FATAL ; WARNING: Shows messages classified as WARNING, ERROR, and FATAL ; INFO: Shows messages classified as INFO, WARNING, ERROR, and FATAL ; DEBUG: Shows messages classified as DEBUG, INFO, WARNING, ERROR, and FATAL ; TRACE : Shows messages classified as TRACE,DEBUG, INFO, WARNING, ERROR, and FATAL ; ALL : Shows messages classified as TRACE,DEBUG, INFO, WARNING, ERROR, and FATAL ; OFF : No log messages display DEV_LOG_LEVEL = "DEBUG" TEST_LOG_LEVEL = "ERROR" PROD_LOG_LEVEL = "OFF" |
You can also output log files anywere from your application using the following:
1 2 3 |
// log file = [console|main] $log_file = 'console'; echo Identity::getLogger()->showLog($log_file); |