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:
Once enabled, you can use the Logger manually in your PHP code.
š Files and Structure
Logger Class:
/core/functions/PHP/classes/Logger.php
Logs Directory:
/core/logs/
system.log
errors.log
security.log
api.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