ILogger

interface OCP\ILogger
Interface ILogger
Implemented by:OC\Log OC\AppFramework\Logger
Source:lib/public/ILogger.php#43

Constants

DEBUG = 0
Source:lib/public/ILogger.php#48
Since:14.0.0
Deprecated:20.0.0
INFO = 1
Source:lib/public/ILogger.php#53
Since:14.0.0
Deprecated:20.0.0
WARN = 2
Source:lib/public/ILogger.php#58
Since:14.0.0
Deprecated:20.0.0
ERROR = 3
Source:lib/public/ILogger.php#63
Since:14.0.0
Deprecated:20.0.0
FATAL = 4
Source:lib/public/ILogger.php#68
Since:14.0.0
Deprecated:20.0.0

Methods

public OCP\ILogger::emergency($message, $context=[])
System is unusable.
Source:

lib/public/ILogger.php#79

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::emergency

public OCP\ILogger::alert($message, $context=[])
Action must be taken immediately.
Source:

lib/public/ILogger.php#90

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::alert

public OCP\ILogger::critical($message, $context=[])
Critical conditions.
Source:

lib/public/ILogger.php#101

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::critical

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

lib/public/ILogger.php#113

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::error

public OCP\ILogger::warning($message, $context=[])
Exceptional occurrences that are not errors.
Source:

lib/public/ILogger.php#124

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::warning

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

lib/public/ILogger.php#135

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::notice

public OCP\ILogger::info($message, $context=[])
Interesting events.
Source:

lib/public/ILogger.php#146

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::info

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

lib/public/ILogger.php#157

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

null

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::debug

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

lib/public/ILogger.php#169

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

mixed

Since:

7.0.0

Deprecated:

20.0.0 use \Psr\Log\LoggerInterface::log

public OCP\ILogger::logException($exception, $context=[])
Logs an exception very detailed
An additional message can we written to the log by adding it to the
context.
<code>
$logger->logException($ex, [
‘message’ => ‘Exception during background job execution’
]);
</code>
Source:

lib/public/ILogger.php#188

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

void

Since:

8.2.0

Deprecated:

20.0.0 use the `exception` entry in the context of any method in \Psr\Log\LoggerInterface