This class can log messages to files or to a MySQL database.
It can add to the log messages with different warning levels: error, warning, debug and information. Messages below a given warning level may be ignored.
The messages can be appended to a log file or stored in MySQL database table.
The log file name, message prefix, database connection details and the database table name are configurable parameters.
The class can retry writing to a log file a given number of times after a period if it fails for instance if the file is temporarily locked. |