Pionia Core

PioniaLogger
in package
implements LoggerInterface Uses Containable

Table of Contents

Interfaces

LoggerInterface

Properties

$context  : ContainerInterface|Container|null
Application container context
$baseLogger  : LoggerInterface
$destination  : string|null
$formatter  : FormatterInterface|null
$handlers  : Arrayable|null
$hiddenKeys  : array<string|int, mixed>
$name  : string
$processors  : Arrayable|null
$settings  : Arrayable

Methods

__construct()  : mixed
addHandler()  : static
alert()  : void
critical()  : void
debug()  : void
emergency()  : void
error()  : void
getOrDefault()  : mixed
Get a value from the container or return a default value
getOrFail()  : mixed
getSilently()  : mixed
hideInLogs()  : array<string|int, mixed>
This method will hide the secure keys in the logs
info()  : void
log()  : void
notice()  : void
resolveDestination()  : void
sets up our logger destination.
set()  : void
Set a value in the container
setLogger()  : void
warning()  : void
contextHas()  : bool
addFormatter()  : void
resolveHandlers()  : void

Properties

$baseLogger

private LoggerInterface $baseLogger = null

|Logger | null The base logger we shall rely on. By default it is the Monolog Logger

$destination

private string|null $destination = null

The destination to log to

$formatter

private FormatterInterface|null $formatter

The formatter to use

$hiddenKeys

private array<string|int, mixed> $hiddenKeys = ['password', 'pass', 'pin', 'passwd', 'secret_key', 'pwd', 'token', 'credit_card', 'creditcard', 'cc', 'secret', 'cvv', 'cvn']

$settings

private Arrayable $settings

The settings for the logger, it is the logging section in the database.ini file or settings from the application

Methods

addHandler()

public addHandler(callable $callable) : static
Parameters
$callable : callable
Return values
static

alert()

public alert(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

critical()

public critical(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

debug()

public debug(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

emergency()

public emergency(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

error()

public error(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

getOrDefault()

Get a value from the container or return a default value

public getOrDefault(string $key, mixed $default) : mixed
Parameters
$key : string
$default : mixed

getOrFail()

public getOrFail(mixed $key) : mixed
Parameters
$key : mixed
Tags
throws
ContainerExceptionInterface
throws
NotFoundExceptionInterface

getSilently()

public getSilently(mixed $key) : mixed
Parameters
$key : mixed

hideInLogs()

This method will hide the secure keys in the logs

public hideInLogs([array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed> = []

The data whose secure keys are to be hidden

Return values
array<string|int, mixed>

The data with the hidden keys hidden

info()

public info(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

log()

public log(mixed $level, Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : mixed
$message : Stringable|string
$context : array<string|int, mixed> = []

notice()

public notice(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

resolveDestination()

sets up our logger destination.

public resolveDestination([string|null $destination = null ]) : void

You can also define the LOG_DESTINATION in the logging section of the database.ini file. This must be relative to the logs folder. If you want to log to a file, you can define the LOGS_DESTINATION_FILE in the context. This will be used as the destination.

Parameters
$destination : string|null = null

set()

Set a value in the container

public set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

setLogger()

public setLogger([LoggerInterface|null $logger = null ]) : void
Parameters
$logger : LoggerInterface|null = null

warning()

public warning(Stringable|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : Stringable|string
$context : array<string|int, mixed> = []

contextHas()

protected contextHas(string $key) : bool
Parameters
$key : string
Return values
bool

addFormatter()

private addFormatter([FormatterInterface|null $formatter = null ]) : void
Parameters
$formatter : FormatterInterface|null = null

        
On this page

Search results