Drupal 8  8.0.2
DbLogController Class Reference
Inheritance diagram for DbLogController:

Public Member Functions

 __construct (Connection $database, ModuleHandlerInterface $module_handler, DateFormatterInterface $date_formatter, FormBuilderInterface $form_builder)
 overview ()
 eventDetails ($event_id)
 formatMessage ($row)
 topLogMessages ($type)

Static Public Member Functions

static create (ContainerInterface $container)
static getLogLevelClassMap ()

Protected Member Functions

 buildFilterQuery ()

Protected Attributes


Detailed Description

Returns responses for dblog routes.

Constructor & Destructor Documentation

__construct ( Connection  $database,
ModuleHandlerInterface  $module_handler,
DateFormatterInterface  $date_formatter,
FormBuilderInterface  $form_builder 

Constructs a DbLogController object.

\Drupal\Core\Database\Connection$databaseA database connection.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerA module handler.
\Drupal\Core\Datetime\DateFormatterInterface$date_formatterThe date formatter service.
\Drupal\Core\Form\FormBuilderInterface$form_builderThe form builder service.

References Drupal\database(), Drupal\entityManager(), Drupal\formBuilder(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

buildFilterQuery ( )

Builds a query for database log administration filters based on session.

array An associative array with keys 'where' and 'args'.

References Drupal\moduleHandler().

Referenced by DbLogController\overview().

Here is the call graph for this function:

Here is the caller graph for this function:

static create ( ContainerInterface  $container)


eventDetails (   $event_id)

Displays details about a specific database log message.

int$event_idUnique ID of the database log message.
array If the ID is located in the Database Logging table, a build array in the format expected by drupal_render();

References Drupal\database(), DbLogController\formatMessage(), Url\fromRoute(), Url\fromUri(), User\getAnonymousUser(), RfcLogLevel\getLevels(), Drupal\l(), and t().

Here is the call graph for this function:

formatMessage (   $row)

Formats a database log message.

object$rowThe record from the watchdog table. The object properties are: wid, uid, severity, type, timestamp, message, variables, link, name.
string|false The formatted log message or FALSE if the message or variables properties are not set.

References t().

Referenced by DbLogController\eventDetails(), DbLogController\overview(), and DbLogController\topLogMessages().

Here is the call graph for this function:

Here is the caller graph for this function:

static getLogLevelClassMap ( )

Gets an array of log level classes.

array An array of log level classes.

References RfcLogLevel\ALERT, RfcLogLevel\CRITICAL, RfcLogLevel\DEBUG, RfcLogLevel\EMERGENCY, RfcLogLevel\ERROR, RfcLogLevel\INFO, RfcLogLevel\NOTICE, and RfcLogLevel\WARNING.

Referenced by DbLogTest\getSeverityConstant().

Here is the caller graph for this function:

overview ( )

Displays a listing of database log messages.

Messages are truncated at 56 chars. Full-length messages can be viewed on the message details page.

array A render array as expected by drupal_render().
See Also

References DbLogController\buildFilterQuery(), Drupal\database(), Html\decodeEntities(), DbLogController\formatMessage(), Drupal\formBuilder(), Html\getClass(), Drupal\l(), Drupal\moduleHandler(), RESPONSIVE_PRIORITY_LOW, RESPONSIVE_PRIORITY_MEDIUM, t(), and Unicode\truncate().

Here is the call graph for this function:

topLogMessages (   $type)

Shows the most frequent log messages of a given event type.

Messages are not truncated on this page because events detailed herein do not have links to a detailed view.

Use one of the above *Report() methods.

string$typeType of database log events to display (e.g., 'search').
array A build array in the format expected by drupal_render().

References Drupal\database(), DbLogController\formatMessage(), and t().

Here is the call graph for this function:

The documentation for this class was generated from the following file: