Constants

WRITER_PREFIX

WRITER_PREFIX

Prefix for ini files.

SETTINGS_INI_PATH

SETTINGS_INI_PATH

Path for main configuration file.

USER_INI_PATH

USER_INI_PATH

Path for credentials configuration file.

PW_STRENGTH

PW_STRENGTH

Minimum length for a password.

Properties

$state

$state : 

Type

$error

$error : 

Type

$warning

$warning : 

Type

$ready

$ready : 

Type

$eolMethod

$eolMethod : 

Type

$eolSequence

$eolSequence : 

Type

$_EOL

$_EOL : 

Type

$logsPath

$logsPath : 

Type

$baseName

$baseName : 

Type

$timestampFormat

$timestampFormat : 

Type

$rotationPolicy

$rotationPolicy : 

Type

$loginUser

$loginUser : 

Type

$loginPwHash

$loginPwHash : 

Type

$htaccessProtection

$htaccessProtection : 

Type

$log_timestamp

$log_timestamp : 

Type

$document_root

$document_root : 

Type

$full_logs_path

$full_logs_path : 

Type

Methods

__construct()

__construct(string  $inifile = null) 

Parameters

string $inifile

Name/path for custom configuration file.

Examples

See "FLW-default.ini" for a detailed description.
** File not found : ./LogWriter/FLW/FLW-default.ini **

writeToLog()

writeToLog(string  $entry) 

Write a log line to a file

Parameters

string $entry

The string to write (representing a logfile line).

existsLogfile()

existsLogfile() : boolean

Check if logfile exists

Returns

boolean

initWriter()

initWriter(string  $inifile = null) 

Initialize the writer.

Parameters

string $inifile

Config. file.

getLogfileLocation()

getLogfileLocation() : string

Get logfile location

Returns

string

prepareHtaccessProtection()

prepareHtaccessProtection() 

Create .htacces and .htpasswd to protect logs directory (if configured).

prepareLogDirectory()

prepareLogDirectory() 

Create logs directory.

setIniKeyDefault()

setIniKeyDefault(string  $key) 

Load configuration default values.

Parameters

string $key

Config. entry name.

validateIniKey()

validateIniKey(string  $key, string  $value = null) : array

Parse configuration values.

Set default value for key if given value is null.

Parameters

string $key

Config. entry name.

string $value

Value to validate..

Returns

array —

Configuration errors.

getLogTimestamp()

getLogTimestamp()