LogText

This class writes logs to a file as text. Normally instances and configs for this class are manages 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).log
"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
"style" : 'one' or 'two' or 'param' or 'arta', defaults to 'arta', the log style
Source
LogText.php
Implements
ILogWriter
Depends on
Arta , Render , FileWriteError
Since
1.4.0

Methods

__construct

LogText $obj = new LogText(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 log 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