Nextcloud PHP API (master)

Log

Namespaces

Audit

Interfaces, Classes, Traits and Enums

IDataLogger
Interface IDataLogger
IFileBased
Interface IFileBased
ILogFactory
Interface ILogFactory
IWriter
Interface IWriter
RotationTrait
Trait RotationTrait

Table of Contents

logger()  : LoggerInterface
Get a PSR logger

Functions

logger()

Get a PSR logger

logger([string|null $appId = null ]) : LoggerInterface

Whenever possible, inject a logger into your classes instead of relying on this helper function.

Parameters
$appId : string|null = null

optional parameter to acquire the app-specific logger

Tags
warning

the returned logger implementation is not guaranteed to be the same between two function calls. During early stages of the process you might in fact get a noop implementation when Nextcloud isn't ready to log. Therefore you MUST NOT cache the result of this function but fetch a new logger for every log line you want to write.

since
24.0.0
Return values
LoggerInterface

Search results