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

 $database
 
 $moduleHandler
 
 $dateFormatter
 
 $formBuilder
 
 $userStorage
 

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.

Parameters
\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 ( )
protected

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

Returns
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)
static

{}

eventDetails (   $event_id)

Displays details about a specific database log message.

Parameters
int$event_idUnique ID of the database log message.
Returns
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.

Parameters
object$rowThe record from the watchdog table. The object properties are: wid, uid, severity, type, timestamp, message, variables, link, name.
Returns
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 ( )
static

Gets an array of log level classes.

Returns
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.

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

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.

Parameters
string$typeType of database log events to display (e.g., 'search').
Returns
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: