Documentation
- Installation
- Controller
- Views
- Database access
- Modules
- Autoloading
- Config management
- Localization
- Logging
- Environment
- Helpers
- Exceptions
- CLI interface
- Events
- Commands
- Authentication
- Caching
- Testing
- mail() wrapper
- SMTP mailer
- HTML helpers
- npm/webpack
Logging
The framework supports logging. When logging is enabled, a logfile will automatically be created inside the /app/logs directory. Log content will be stored in text files per day. Logging can be toggled via the LOG_ENABLE environment variable.
Use the addLog() function in order to log to the buffer.
function addLog($type, $line);
You can use different log types:
- ASATRU_LOG_INFO: An information message
- ASATRU_LOG_DEBUG: A debug message
- ASATRU_LOG_WARNING: A warning message
- ASATRU_LOG_ERROR: An error message
An example log content can log like the following:
[2020-02-1 03:02:17 pm][Header] Asatru PHP log on 2020-02-1 03:02:17 pm
[2020-02-1 03:02:17 pm][Info] TestCase Info
[2020-02-1 03:02:17 pm][Debug] TestCase Debug
[2020-02-1 03:02:17 pm][Warning] TestCase Warning
[2020-02-1 03:02:17 pm][Error] TestCase Error
In order to clean the current log buffer use
function clearLog();
In order to force storing the current log buffer use
function storeLog();