Log¶
-
class
OC\
Log
¶ - logging utilitiesThis is a stand in, this should be replaced by a Psr\Log\LoggerInterfacecompatible logger. See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.mdfor the full interface specification.MonoLog is an example implementing this interface.
Source: lib/private/Log.php#57 Implements: OCP\ILogger
OCP\Log\IDataLogger
Properties¶
Methods¶
-
public
OC\Log::
__construct
($logger, $config=null, $normalizer=null, $registry=null)¶ Source: Parameters: - $logger (
OCP\Log\IWriter
) The logger that should be used - $config (
OC\SystemConfig
) the system config object - $normalizer (
Nextcloud\LogNormalizer\Normalizer
| null) - $registry (
OCP\Support\CrashReport\IRegistry
| null)
- $logger (
-
public
OC\Log::
emergency
($message, $context=[])¶ - System is unusable.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
alert
($message, $context=[])¶ - Action must be taken immediately.Example: Entire website down, database unavailable, etc. This shouldtrigger the SMS alerts and wake you up.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
critical
($message, $context=[])¶ - Critical conditions.Example: Application component unavailable, unexpected exception.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
error
($message, $context=[])¶ - Runtime errors that do not require immediate action but should typicallybe logged and monitored.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
warning
($message, $context=[])¶ - Exceptional occurrences that are not errors.Example: Use of deprecated APIs, poor use of an API, undesirable thingsthat are not necessarily wrong.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
notice
($message, $context=[])¶ - Normal but significant events.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
info
($message, $context=[])¶ - Interesting events.Example: User logs in, SQL logs.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
debug
($message, $context=[])¶ - Detailed debug information.
Source: Parameters: - $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
log
($level, $message, $context=[])¶ - Logs with an arbitrary level.
Source: Parameters: - $level (int)
- $message (string)
- $context (array)
Returns: void
-
public
OC\Log::
logException
($exception, $context=[])¶ - Logs an exception very detailed
Source: Parameters: - $exception (
Exception
|\Throwable
) - $context (array)
Returns: void
Since: 8.2.0
- $exception (
-
public
OC\Log::
logData
($message, $data, $context=[])¶ Source: lib/private/Log.php#342
-
protected
OC\Log::
writeLog
($app, $entry, $level)¶ Source: Parameters: - $app (string)
- $entry (string | array)
- $level (int)
-
public
OC\Log::
getLogPath
()¶ Source: lib/private/Log.php#374