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, string|array|null $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(mixed $message, $exceptionFile = null)

No description

string
getExceptionFile(Exception|Throwable $exception)

No description

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

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

void
sendEmail(mixed $message)

No description

void
defaultMailer(mixed $message, string $email)

Default mailer.

Details

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

No description

Parameters

string|null $directory
string|array|null $email
BlueScreen $blueScreen

at line 54
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)

No description

Parameters

mixed $message

Return Value

string

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

No description

Parameters

mixed $message
$exceptionFile

Return Value

string

at line 127
string getExceptionFile(Exception|Throwable $exception)

No description

Parameters

Exception|Throwable $exception

Return Value

string

at line 152
protected string logException(Exception|Throwable $exception, $file = null)

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

Parameters

Exception|Throwable $exception
$file

Return Value

string

logged error filename

at line 165
protected void sendEmail(mixed $message)

No description

Parameters

mixed $message

Return Value

void

at line 189
void defaultMailer(mixed $message, string $email)

internal  
 

Default mailer.

Parameters

mixed $message
string $email

Return Value

void