Logger
INEX SPA - Logger System Documentation
π Feature: Logger System
INEX SPA includes a lightweight, powerful logging system that allows developers to log important events, errors, and security-related actions. It helps in debugging, monitoring, and maintaining the integrity of your application.
π οΈ Enable Logging
To enable the Logger system, open your .env file and set the following:
USE_LOGGING=trueOnce enabled, you can use the Logger manually in your PHP code.
π Files and Structure
Logger Class:
/core/functions/PHP/classes/Logger.phpLogs Directory:
/core/logs/system.logerrors.logsecurity.logapi.log
βοΈ Logger Functions
β€ Logger::log($type, $message)
Logs a message with a specific type.
$type: One of the following:system: For general events.error: For errors and exceptions.security: For unauthorized access, login attempts, etc.api: For tracking API calls or integrations.
Example:
β€ Logger::clearLogs()
Clears the content of all log files.
Example:
π You can restrict access to
clearLogs()usage in production.
π Log Format
Each entry is recorded like this:
Example:
β
Status
β Lightweight β Easy to configure β Extensible β No external libraries
Β© INEX SPA Team - Logger System
Last updated