class Logger (View source)

Constants

DEBUG

INFO

WARNING

ERROR

EXCEPTION

CRITICAL

Properties

string|null $directory

Path ke di direktori penyimpanan file log.

string|array $email

Email yang akan menerima notifikasi error.

string $fromEmail

Email pengirim notifikasi error.

mixed $emailSnooze

Interval pengiriman email notifikasi (default 2 hari).

callable $mailer

Handler pengiriman email.

Methods

__construct(string|null $directory, string|array|null $email = null, Panic $panic = null)

No description

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

Log pesan atau exception ke file dan kirim ke email.

static string
formatMessage(mixed $message)

No description

static string
formatLogLine(mixed $message, $excfile = null, $priority = self::INFO)

No description

string
getExceptionFile(Throwable|Exception $exception)

No description

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

Log exception ke file.

void
sendEmail(mixed $message)

No description

void
defaultMailer(mixed $message, string $email)

Mailer default.

Details

__construct(string|null $directory, string|array|null $email = null, Panic $panic = null)

No description

Parameters

string|null $directory
string|array|null $email
Panic $panic

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

Log pesan atau exception ke file dan kirim ke email.

Parameters

mixed $message
string $priority

Return Value

string|null

static string formatMessage(mixed $message)

No description

Parameters

mixed $message

Return Value

string

static string formatLogLine(mixed $message, $excfile = null, $priority = self::INFO)

No description

Parameters

mixed $message
$excfile
$priority

Return Value

string

string getExceptionFile(Throwable|Exception $exception)

No description

Parameters

Throwable|Exception $exception

Return Value

string

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

Log exception ke file.

Parameters

Throwable|Exception $exception
$file

Return Value

string

protected void sendEmail(mixed $message)

No description

Parameters

mixed $message

Return Value

void

void defaultMailer(mixed $message, string $email)

Mailer default.

Parameters

mixed $message
string $email

Return Value

void