SilverStripe Search

SolrLogger
in package

Class SolrLogger

Log information from Solr to the CMS for reference

Table of Contents

Properties

$client  : Client
$options  : array<string|int, mixed>

Methods

__construct()  : mixed
SolrLogger constructor.
getClient()  : Client
Return the Guzzle Client
getOptions()  : array<string|int, mixed>
Get the options for Guzzle
logMessage()  : void
Log the given message and dump it out.
saveSolrLog()  : void
Save the latest Solr errors to the log
setClient()  : SolrLogger
Set the Guzzle client
setOptions()  : void
Set custom options for Guzzle
findOrCreateLog()  : void
Attempt to find, otherwise create, a log object

Properties

$client

protected Client $client

Guzzle base client to communicate with Solr

$options

protected array<string|int, mixed> $options = []

Default options

Methods

__construct()

SolrLogger constructor.

public __construct([null|Countable $handler = null ]) : mixed
Parameters
$handler : null|Countable = null

getClient()

Return the Guzzle Client

public getClient() : Client
Return values
Client

getOptions()

Get the options for Guzzle

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

logMessage()

Log the given message and dump it out.

public static logMessage(string $type, string $message) : void

Also boot the Log to get the latest errors from Solr

Parameters
$type : string
$message : string
Tags
throws
HTTPException
throws
ValidationException

saveSolrLog()

Save the latest Solr errors to the log

public saveSolrLog([string $type = 'Query' ]) : void
Parameters
$type : string = 'Query'
Tags
throws
HTTPException
throws
ValidationException

setOptions()

Set custom options for Guzzle

public setOptions(array<string|int, mixed> $options) : void
Parameters
$options : array<string|int, mixed>

findOrCreateLog()

Attempt to find, otherwise create, a log object

private findOrCreateLog( $type, array<string|int, mixed> $filter,  $error) : void
Parameters
$type :
$filter : array<string|int, mixed>
$error :
Tags
throws
ValidationException

        
On this page

Search results