class Logger implements ILogger

Logger.

Properties

string|null $directory
string|array|null $email
string|null $fromEmail
mixed $emailSnooze
callable $mailer

Methods

__construct(string|null $directory, $email = null, BlueScreen $blueScreen = null)

No description

log(mixed $message, $priority = self::INFO)

Logs message or exception to file and sends email notification.

static string
formatMessage(mixed $message)

No description

static string
formatLogLine($message, string $exceptionFile = null)

No description

string
getExceptionFile(Throwable $exception)

No description

string
logException(Throwable $exception, string $file = null)

Logs exception to the file if file doesn't exist.

void
sendEmail(mixed $message)

No description

void
defaultMailer($message, string $email)

Default mailer.

Details

at line 40
__construct(string|null $directory, $email = null, BlueScreen $blueScreen = null)

Parameters

string|null $directory
$email
BlueScreen $blueScreen

at line 55
log(mixed $message, $priority = self::INFO)

Logs message or exception to file and sends email notification.

Parameters

mixed $message
$priority

at line 88
static string formatMessage(mixed $message)

Parameters

mixed $message

Return Value

string

at line 111
static string formatLogLine($message, string $exceptionFile = null)

Parameters

$message
string $exceptionFile

Return Value

string

at line 122
string getExceptionFile(Throwable $exception)

Parameters

Throwable $exception

Return Value

string

at line 146
protected string logException(Throwable $exception, string $file = null)

Logs exception to the file if file doesn't exist.

Parameters

Throwable $exception
string $file

Return Value

string logged error filename

at line 158
protected void sendEmail(mixed $message)

Parameters

mixed $message

Return Value

void

at line 180
void defaultMailer($message, string $email)

Default mailer.

Parameters

$message
string $email

Return Value

void