Neuron-PHP

Nightwatch extends Base
in package

Formats log data for Laravel Nightwatch API.

This formatter produces JSON output specifically structured for the Laravel Nightwatch monitoring service. It maps Neuron's log levels to Laravel/Monolog standard levels and includes all necessary metadata for proper integration with Nightwatch's logging system.

Table of Contents

Properties

$applicationName  : string
$defaultChannel  : string

Methods

__construct()  : mixed
format()  : string
Formats log data into Nightwatch-compatible JSON structure.
getContextString()  : string
valueToString()  : string
Converts a value to string representation for logging.
formatException()  : array<string|int, mixed>
Formats an exception for Nightwatch.
mapLogLevel()  : string
Maps Neuron RunLevel to Laravel/Monolog log level strings.

Properties

$applicationName

private string $applicationName

Methods

__construct()

public __construct([string $defaultChannel = 'neuron' ][, string $applicationName = '' ]) : mixed
Parameters
$defaultChannel : string = 'neuron'

Default channel if none provided by Data (default: 'neuron')

$applicationName : string = ''

Optional application identifier

format()

Formats log data into Nightwatch-compatible JSON structure.

public format(Data $data) : string
Parameters
$data : Data

The log data to format

Return values
string

JSON-encoded log data for Nightwatch API

getContextString()

protected getContextString(array<string|int, mixed> $contextList) : string
Parameters
$contextList : array<string|int, mixed>
Return values
string

valueToString()

Converts a value to string representation for logging.

protected valueToString(mixed $value) : string
Parameters
$value : mixed
Return values
string

formatException()

Formats an exception for Nightwatch.

private formatException(Throwable $exception) : array<string|int, mixed>
Parameters
$exception : Throwable
Return values
array<string|int, mixed>

mapLogLevel()

Maps Neuron RunLevel to Laravel/Monolog log level strings.

private mapLogLevel(RunLevel $level) : string
Parameters
$level : RunLevel

The Neuron log level

Return values
string

The corresponding Laravel/Monolog level


        
On this page

Search results