CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C Elastic Search 4.x API

  • Project:
    • Elastic Search
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.x
      • 4.x
      • 3.x
      • 2.x

Namespaces

  • Cake\ElasticSearch
    • Association
    • Datasource
      • Log
    • Exception
    • Rule
    • TestSuite
    • View

Class ElasticLogger

Adapter to convert elastic logs to QueryLogger readable content

Namespace: Cake\ElasticSearch\Datasource\Log

Property Summary

  • $_connection protected
    Cake\ElasticSearch\Datasource\Connection

    Holds the connection instance

  • $_logger protected
    Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface

    Holds the logger instance

Method Summary

  • __construct() public

    Constructor, set the QueryLogger instance

  • _log() protected

    Format log messages from the Elastica client and pass them to the cake defined logger instance

  • alert() public

    Action must be taken immediately.

  • critical() public

    Critical conditions.

  • debug() public

    Detailed debug information.

  • emergency() public

    System is unusable.

  • error() public

    Runtime errors that do not require immediate action but should typically be logged and monitored.

  • getLogger() public

    Return the current logger

  • info() public

    Interesting events.

  • log() public

    Format log messages from the Elastica client _log method

  • notice() public

    Normal but significant events.

  • setLogger() public

    Set the current cake logger

  • warning() public

    Exceptional occurrences that are not errors.

Method Detail

__construct() ¶ public

__construct(Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface $logger, Cake\ElasticSearch\Datasource\Connection $connection)

Constructor, set the QueryLogger instance

Parameters
Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface $logger

Instance of the QueryLogger

Cake\ElasticSearch\Datasource\Connection $connection

Current connection instance

_log() ¶ protected

_log(string $level, string $message, array $context = []): void

Format log messages from the Elastica client and pass them to the cake defined logger instance

Elastica's log parameters

error: message: "Elastica Request Failure" context: [ exception, request, retry ] debug (request): message: "Elastica Request" context: [ request, response, responseStatus, query ] debug (fallback?): message: "Elastica Request" context: [ message, query ]

Parameters
string $level

The log level

string $message

The log message

array $context optional

log context

Returns
void

alert() ¶ public

alert(string|Stringable $message, mixed[] $context = []): void

Action must be taken immediately.

Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

critical() ¶ public

critical(string|Stringable $message, mixed[] $context = []): void

Critical conditions.

Example: Application component unavailable, unexpected exception.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

debug() ¶ public

debug(string|Stringable $message, mixed[] $context = []): void

Detailed debug information.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

emergency() ¶ public

emergency(string|Stringable $message, mixed[] $context = []): void

System is unusable.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

error() ¶ public

error(string|Stringable $message, mixed[] $context = []): void

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

getLogger() ¶ public

getLogger(): Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface

Return the current logger

Returns
Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface

info() ¶ public

info(string|Stringable $message, mixed[] $context = []): void

Interesting events.

Example: User logs in, SQL logs.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

log() ¶ public

log(mixed $level, Stringable|string $message, mixed[] $context = []): void

Format log messages from the Elastica client _log method

Parameters
mixed $level

The log level

Stringable|string $message

The log message

mixed[] $context optional

log context

Returns
void

notice() ¶ public

notice(string|Stringable $message, mixed[] $context = []): void

Normal but significant events.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

setLogger() ¶ public

setLogger(Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface $logger): $this

Set the current cake logger

Parameters
Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface $logger

Set logger instance to pass logging data to

Returns
$this

warning() ¶ public

warning(string|Stringable $message, mixed[] $context = []): void

Exceptional occurrences that are not errors.

Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

Parameters
string|Stringable $message
mixed[] $context optional
Returns
void

Property Detail

$_connection ¶ protected

Holds the connection instance

Type
Cake\ElasticSearch\Datasource\Connection

$_logger ¶ protected

Holds the logger instance

Type
Cake\Database\Log\QueryLogger|Psr\Log\LoggerInterface
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs