LogCsv

This class writes logs to a csv file as text. Normally instances and configs for this class are managed and accessed through the Log class which is the object factory for the log classes. The available config keys for this class are:
"log_file" : log file, defaults to TEMP_DIR/logs/date(Y-m-d).csv
"json" : boolean, defaults to false, true=log array comments as JSON
"user_data" : boolean, defaults to true, true=add user id, username and IP if available
"compact" : boolean, defaults to false, true=put array comments in one column
Source
LogCsv.php
Implements
ILogWriter
Depends on
Arta , Render , FileWriteError
Since
1.4.0

Methods

__construct

LogCsv $obj = new LogCsv(string objectName)

Create and config a log writer instance.

Arguments

    objectName (string)
    The name of log writer object, normally you define a logger in the application's config array or ini file, then you access the logger object using the name specified for it there

Returns

void

write

void $obj->write(string level, string title, string | array comment)

Write into the end of a csv file. If file-name not exists in the settings the the filepath will be "TEMP_DIR/logs/date(Y-m-d).log". Use the static methods in "Log::..." instead of using this method directly.

Arguments

    level (string)
    Log level e.g. Error or Warn or Info or etc.
    title (string)
    Log title
    comment (string | array)
    Comment to be written to the log

Returns

void

Throws