Log

class OC\Log
logging utilities
This is a stand in, this should be replaced by a Psr\Log\LoggerInterface
for 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:

lib/private/Log.php#80

Parameters:
public OC\Log::emergency($message, $context=[])
System is unusable.
Source:

lib/private/Log.php#103

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 should
trigger the SMS alerts and wake you up.
Source:

lib/private/Log.php#117

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::critical($message, $context=[])
Critical conditions.
Example: Application component unavailable, unexpected exception.
Source:

lib/private/Log.php#130

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::error($message, $context=[])
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Source:

lib/private/Log.php#142

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 things
that are not necessarily wrong.
Source:

lib/private/Log.php#156

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::notice($message, $context=[])
Normal but significant events.
Source:

lib/private/Log.php#167

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::info($message, $context=[])
Interesting events.
Example: User logs in, SQL logs.
Source:

lib/private/Log.php#180

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::debug($message, $context=[])
Detailed debug information.
Source:

lib/private/Log.php#191

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::log($level, $message, $context=[])
Logs with an arbitrary level.
Source:

lib/private/Log.php#204

Parameters:
  • $level (int)
  • $message (string)
  • $context (array)
Returns:

void

public OC\Log::logException($exception, $context=[])
Logs an exception very detailed
Source:

lib/private/Log.php#313

Parameters:
  • $exception (Exception | \Throwable)
  • $context (array)
Returns:

void

Since:

8.2.0

public OC\Log::logData($message, $data, $context=[])
Source:lib/private/Log.php#342
protected OC\Log::writeLog($app, $entry, $level)
Source:

lib/private/Log.php#370

Parameters:
  • $app (string)
  • $entry (string | array)
  • $level (int)
public OC\Log::getLogPath()
Source:lib/private/Log.php#374