BackendLogController extends ActionController

Show log entries from sys_log

Internal

This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.

Table of Contents

Properties

$actionMethodName  : string
Name of the action method
$arguments  : Arguments
$configurationManager  : ConfigurationManagerInterface
$connectionPool  : ConnectionPool
$defaultViewObjectName  : string
The default view object to use if none of the resolved views can render a response for the current request.
$errorMethodName  : string
Name of the special error action method which is called in case of errors
$eventDispatcher  : EventDispatcherInterface
$hashService  : HashService
$logEntryRepository  : LogEntryRepository
$moduleTemplateFactory  : ModuleTemplateFactory
$mvcPropertyMappingConfigurationService  : MvcPropertyMappingConfigurationService
$reflectionService  : ReflectionService
$request  : RequestInterface
The current request.
$responseFactory  : ResponseFactoryInterface
$settings  : array<string|int, mixed>
Contains the settings of the current extension
$streamFactory  : StreamFactoryInterface
$uriBuilder  : UriBuilder
$validatorResolver  : ValidatorResolver
$view  : ViewInterface
The current view, as resolved by resolveView()

Methods

__construct()  : mixed
addFlashMessage()  : mixed
Creates a Message object and adds it to the FlashMessageQueue.
deleteMessageAction()  : ResponseInterface
Delete all log entries that share the same message with the log entry given in $errorUid
initializeControllerArgumentsBaseValidators()  : mixed
Collects the base validators which were defined for the data type of each controller argument and adds them to the argument's validator chain.
initializeListAction()  : void
Initialize list action
injectConfigurationManager()  : mixed
injectEventDispatcher()  : void
injectHashService()  : mixed
injectInternalExtensionService()  : void
injectInternalFlashMessageService()  : void
injectMvcPropertyMappingConfigurationService()  : mixed
injectPropertyMapper()  : void
injectReflectionService()  : mixed
injectResponseFactory()  : mixed
injectStreamFactory()  : mixed
injectValidatorResolver()  : mixed
injectViewResolver()  : mixed
listAction()  : ResponseInterface
Show general information and the installed modules
processRequest()  : ResponseInterface
Handles an incoming request and returns a response object
throwStatus()  : never
Sends the specified HTTP status immediately and only stops to run back through the middleware stack.
addBaseUriIfNecessary()  : string
Adds the base uri if not already in place.
addErrorFlashMessage()  : mixed
If an error occurred during this request, this adds a flash message describing the error to the flash message container.
callActionMethod()  : ResponseInterface
Calls the specified action method and passes the arguments.
createPageDepthOptions()  : array<string|int, mixed>
Create options for the 'depth of page levels' selector.
createSelectableNumberOfLogEntriesOptions()  : array<string|int, mixed>
Options for the "max" drop down
createUserAndGroupListForSelectOptions()  : array<string|int, mixed>
Create options for the user / group drop down.
createWorkspaceListForSelectOptions()  : array<string|int, mixed>
Create options for the workspace selector
errorAction()  : ResponseInterface
A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.
forceWorkspaceSelectionIfInWorkspace()  : bool
If the user is in a workspace different than LIVE, we force to show only log entries from the selected workspace, and the workspace selector is not shown.
forwardToReferringRequest()  : ResponseInterface|null
If information on the request before the current request was sent, this method forwards back to the originating request. This effectively ends processing of the current request, so do not call this method before you have finished the necessary business logic!
getBackendUser()  : BackendUserAuthentication
getConstraintFromBeUserData()  : Constraint
Get module states (the constraint object) from user data
getErrorFlashMessage()  : string|bool
A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.
getFlashMessageQueue()  : FlashMessageQueue
todo: As soon as the incoming request contains the compiled plugin namespace, extbase will offer a trait to create a flash message identifier from the current request. Users then should inject the flash message service themselves if needed.
getFlattenedValidationErrorMessage()  : string
Returns a string with a basic error message about validation failure.
groupLogEntriesDay()  : array<string|int, mixed>
Create a sorted array for day from the query result of the sys log repository.
htmlResponse()  : ResponseInterface
Returns a response object with either the given html string or the current rendered view as content.
initializeAction()  : mixed
Initializes the controller before invoking an action method.
initializeActionMethodArguments()  : void
Implementation of the arguments initialization in the action controller: Automatically registers arguments of the current action
initializeActionMethodValidators()  : void
Adds the needed validators to the Arguments:
jsonResponse()  : ResponseInterface
Returns a response object with either the given json string or the current rendered view as content. Mainly to be used for actions / controllers using the JsonView.
mapRequestArgumentsToControllerArguments()  : mixed
Maps arguments delivered by the request object to the local controller arguments.
persistConstraintInBeUserData()  : void
Save current constraint object in be user settings (uC)
redirect()  : ResponseInterface
Redirects the request to another action and / or controller.
redirectToUri()  : ResponseInterface
Redirects the web request to another uri.
renderAssetsForRequest()  : void
Method which initializes assets that should be attached to the response for the given $request, which contains parameters that an override can use to determine which assets to add via PageRenderer.
resetConstraintsOnMemoryExhaustionError()  : void
In case the script execution fails, because the user requested too many results (memory exhaustion in php), reset the constraints in be user settings, so the belog can be accessed again in the next call.
resolveActionMethodName()  : string
Resolves and checks the current action method name
resolveView()  : ViewInterface
Prepares a view for the current action.
setStartAndEndTimeFromTimeSelector()  : void
Calculate the start- and end timestamp
setViewConfiguration()  : void

Properties

$actionMethodName

Name of the action method

protected string $actionMethodName = 'indexAction'
Internal

only to be used within Extbase, not part of TYPO3 Core API.

$defaultViewObjectName

The default view object to use if none of the resolved views can render a response for the current request.

protected string $defaultViewObjectName = \TYPO3\CMS\Fluid\View\TemplateView::class

$errorMethodName

Name of the special error action method which is called in case of errors

protected string $errorMethodName = 'errorAction'

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

$hashService

protected HashService $hashService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

$reflectionService

protected ReflectionService $reflectionService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

$responseFactory

protected ResponseFactoryInterface $responseFactory

$settings

Contains the settings of the current extension

protected array<string|int, mixed> $settings

$streamFactory

protected StreamFactoryInterface $streamFactory

$validatorResolver

protected ValidatorResolver $validatorResolver
Internal

only to be used within Extbase, not part of TYPO3 Core API.

$view

The current view, as resolved by resolveView()

protected ViewInterface $view

Methods

addFlashMessage()

Creates a Message object and adds it to the FlashMessageQueue.

public addFlashMessage(string $messageBody[, string $messageTitle = '' ][, int|ContextualFeedbackSeverity $severity = ContextualFeedbackSeverity::OK ][, bool $storeInSession = true ]) : mixed
Parameters
$messageBody : string
$messageTitle : string = ''

Optional message title

$severity : int|ContextualFeedbackSeverity = ContextualFeedbackSeverity::OK

Optional severity, must be one of \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity cases. Accepts int values as well, which is deprecated.

$storeInSession : bool = true

Optional, defines whether the message should be stored in the session (default) or not

Tags
throws
InvalidArgumentException

if the message body is no string

see
FlashMessage
todo:

Change $severity to allow ContextualFeedbackSeverity only in v13

deleteMessageAction()

Delete all log entries that share the same message with the log entry given in $errorUid

public deleteMessageAction(int $errorUid) : ResponseInterface
Parameters
$errorUid : int
Return values
ResponseInterface

initializeControllerArgumentsBaseValidators()

Collects the base validators which were defined for the data type of each controller argument and adds them to the argument's validator chain.

public initializeControllerArgumentsBaseValidators() : mixed
Internal

only to be used within Extbase, not part of TYPO3 Core API.

initializeListAction()

Initialize list action

public initializeListAction() : void

injectEventDispatcher()

public injectEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
$eventDispatcher : EventDispatcherInterface

injectHashService()

public injectHashService(HashService $hashService) : mixed
Parameters
$hashService : HashService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

injectInternalExtensionService()

public final injectInternalExtensionService(ExtensionService $extensionService) : void
Parameters
$extensionService : ExtensionService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

injectInternalFlashMessageService()

public final injectInternalFlashMessageService(FlashMessageService $flashMessageService) : void
Parameters
$flashMessageService : FlashMessageService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

injectPropertyMapper()

public injectPropertyMapper(PropertyMapper $propertyMapper) : void
Parameters
$propertyMapper : PropertyMapper
Internal

only to be used within Extbase, not part of TYPO3 Core API.

injectReflectionService()

public injectReflectionService(ReflectionService $reflectionService) : mixed
Parameters
$reflectionService : ReflectionService
Internal

only to be used within Extbase, not part of TYPO3 Core API.

injectResponseFactory()

public final injectResponseFactory(ResponseFactoryInterface $responseFactory) : mixed
Parameters
$responseFactory : ResponseFactoryInterface

injectStreamFactory()

public final injectStreamFactory(StreamFactoryInterface $streamFactory) : mixed
Parameters
$streamFactory : StreamFactoryInterface

injectValidatorResolver()

public injectValidatorResolver(ValidatorResolver $validatorResolver) : mixed
Parameters
$validatorResolver : ValidatorResolver
Internal

only to be used within Extbase, not part of TYPO3 Core API.

listAction()

Show general information and the installed modules

public listAction([Constraint|null $constraint = null ][, string $operation = '' ]) : ResponseInterface
Parameters
$constraint : Constraint|null = null
$operation : string = ''
Return values
ResponseInterface

processRequest()

Handles an incoming request and returns a response object

public processRequest(RequestInterface $request) : ResponseInterface
Parameters
$request : RequestInterface

The request object

Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
ResponseInterface

throwStatus()

Sends the specified HTTP status immediately and only stops to run back through the middleware stack.

public throwStatus(int $statusCode[, string $statusMessage = null ][, string $content = null ]) : never

Note: If any other plugin or content or hook is used within a frontend request, this is skipped by design.

Parameters
$statusCode : int

The HTTP status code

$statusMessage : string = null

A custom HTTP status message

$content : string = null

Body content which further explains the status

Tags
throws
PropagateResponseException
Return values
never

addBaseUriIfNecessary()

Adds the base uri if not already in place.

protected addBaseUriIfNecessary(string $uri) : string
Parameters
$uri : string

The URI

Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
string

addErrorFlashMessage()

If an error occurred during this request, this adds a flash message describing the error to the flash message container.

protected addErrorFlashMessage() : mixed
Internal

only to be used within Extbase, not part of TYPO3 Core API.

callActionMethod()

Calls the specified action method and passes the arguments.

protected callActionMethod(RequestInterface $request) : ResponseInterface

If the action returns a string, it is appended to the content in the response object. If the action doesn't return anything and a valid view exists, the view is rendered automatically.

Parameters
$request : RequestInterface
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
ResponseInterface

createPageDepthOptions()

Create options for the 'depth of page levels' selector.

protected createPageDepthOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

Key is depth identifier (1 = One level), value the localized select option label

createSelectableNumberOfLogEntriesOptions()

Options for the "max" drop down

protected createSelectableNumberOfLogEntriesOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

createUserAndGroupListForSelectOptions()

Create options for the user / group drop down.

protected createUserAndGroupListForSelectOptions() : array<string|int, mixed>

This is not moved to a repository by intention to not mix up this 'meta' data with real repository work.

Return values
array<string|int, mixed>

createWorkspaceListForSelectOptions()

Create options for the workspace selector

protected createWorkspaceListForSelectOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

Key is uid of workspace, value its label

errorAction()

A special action which is called if the originally intended action could not be called, for example if the arguments were not valid.

protected errorAction() : ResponseInterface

The default implementation sets a flash message, request errors and forwards back to the originating action. This is suitable for most actions dealing with form input.

We clear the page cache by default on an error as well, as we need to make sure the data is re-evaluated when the user changes something.

Return values
ResponseInterface

forceWorkspaceSelectionIfInWorkspace()

If the user is in a workspace different than LIVE, we force to show only log entries from the selected workspace, and the workspace selector is not shown.

protected forceWorkspaceSelectionIfInWorkspace(Constraint $constraint) : bool
Parameters
$constraint : Constraint
Return values
bool

forwardToReferringRequest()

If information on the request before the current request was sent, this method forwards back to the originating request. This effectively ends processing of the current request, so do not call this method before you have finished the necessary business logic!

protected forwardToReferringRequest() : ResponseInterface|null
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
ResponseInterface|null

getConstraintFromBeUserData()

Get module states (the constraint object) from user data

protected getConstraintFromBeUserData() : Constraint
Return values
Constraint

getErrorFlashMessage()

A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.

protected getErrorFlashMessage() : string|bool
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
string|bool

The flash message or FALSE if no flash message should be set

getFlashMessageQueue()

todo: As soon as the incoming request contains the compiled plugin namespace, extbase will offer a trait to create a flash message identifier from the current request. Users then should inject the flash message service themselves if needed.

protected getFlashMessageQueue([string|null $identifier = null ]) : FlashMessageQueue
Parameters
$identifier : string|null = null
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
FlashMessageQueue

getFlattenedValidationErrorMessage()

Returns a string with a basic error message about validation failure.

protected getFlattenedValidationErrorMessage() : string

We may add all validation error messages to a log file in the future, but for security reasons (@see #54074) we do not return these here.

Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
string

groupLogEntriesDay()

Create a sorted array for day from the query result of the sys log repository.

protected groupLogEntriesDay(QueryResultInterface $logEntries) : array<string|int, mixed>

pid is always -1 to render a flat list. '12345' is a sub array to split entries by day, number is first second of day

[pid][dayTimestamp][items]

Parameters
$logEntries : QueryResultInterface
Return values
array<string|int, mixed>

htmlResponse()

Returns a response object with either the given html string or the current rendered view as content.

protected htmlResponse([string|null $html = null ]) : ResponseInterface
Parameters
$html : string|null = null
Return values
ResponseInterface

initializeAction()

Initializes the controller before invoking an action method.

protected initializeAction() : mixed

Override this method to solve tasks which all actions have in common.

initializeActionMethodArguments()

Implementation of the arguments initialization in the action controller: Automatically registers arguments of the current action

protected initializeActionMethodArguments() : void

Don't override this method - use initializeAction() instead.

Internal

only to be used within Extbase, not part of TYPO3 Core API.

Tags
throws
InvalidArgumentTypeException
see
initializeArguments()

initializeActionMethodValidators()

Adds the needed validators to the Arguments:

protected initializeActionMethodValidators() : void
  • Validators checking the data type from the @param annotation
  • Custom validators specified with validate annotations.
  • Model-based validators (validate annotations in the model)
  • Custom model validator classes
Internal

only to be used within Extbase, not part of TYPO3 Core API.

jsonResponse()

Returns a response object with either the given json string or the current rendered view as content. Mainly to be used for actions / controllers using the JsonView.

protected jsonResponse([string|null $json = null ]) : ResponseInterface
Parameters
$json : string|null = null
Return values
ResponseInterface

mapRequestArgumentsToControllerArguments()

Maps arguments delivered by the request object to the local controller arguments.

protected mapRequestArgumentsToControllerArguments() : mixed
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Tags
throws
RequiredArgumentMissingException

persistConstraintInBeUserData()

Save current constraint object in be user settings (uC)

protected persistConstraintInBeUserData(Constraint $constraint) : void
Parameters
$constraint : Constraint

redirect()

Redirects the request to another action and / or controller.

protected redirect(string|null $actionName[, string|null $controllerName = null ][, string|null $extensionName = null ][, array<string|int, mixed>|null $arguments = null ][, int|null $pageUid = null ][, null $_ = null ][, int $statusCode = 303 ]) : ResponseInterface

Redirect will be sent to the client which then performs another request to the new URI.

Parameters
$actionName : string|null

Name of the action to forward to

$controllerName : string|null = null

Unqualified object name of the controller to forward to. If not specified, the current controller is used.

$extensionName : string|null = null

Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.

$arguments : array<string|int, mixed>|null = null

Arguments to pass to the target action

$pageUid : int|null = null

Target page uid. If NULL, the current page uid is used

$_ : null = null

(optional) Unused

$statusCode : int = 303

(optional) The HTTP status code for the redirect. Default is "303 See Other

Return values
ResponseInterface

redirectToUri()

Redirects the web request to another uri.

protected redirectToUri(mixed $uri[, null $_ = null ][, int $statusCode = 303 ]) : ResponseInterface
Parameters
$uri : mixed

A string representation of a URI

$_ : null = null

(optional) Unused

$statusCode : int = 303

(optional) The HTTP status code for the redirect. Default is "303 See Other"

Return values
ResponseInterface

renderAssetsForRequest()

Method which initializes assets that should be attached to the response for the given $request, which contains parameters that an override can use to determine which assets to add via PageRenderer.

protected renderAssetsForRequest(RequestInterface $request) : void

This default implementation will attempt to render the sections "HeaderAssets" and "FooterAssets" from the template that is being rendered, inserting the rendered content into either page header or footer, as appropriate. Both sections are optional and can be used one or both in combination.

You can add assets with this method without worrying about duplicates, if for example you do this in a plugin that gets used multiple time on a page.

Parameters
$request : RequestInterface
Internal

only to be used within Extbase, not part of TYPO3 Core API.

resetConstraintsOnMemoryExhaustionError()

In case the script execution fails, because the user requested too many results (memory exhaustion in php), reset the constraints in be user settings, so the belog can be accessed again in the next call.

protected resetConstraintsOnMemoryExhaustionError() : void

resolveActionMethodName()

Resolves and checks the current action method name

protected resolveActionMethodName() : string
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Tags
throws
NoSuchActionException

if the action specified in the request object does not exist (and if there's no default action either).

Return values
string

Method name of the current action

resolveView()

Prepares a view for the current action.

protected resolveView() : ViewInterface

By default, this method tries to locate a view with a name matching the current action.

Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
ViewInterface

setStartAndEndTimeFromTimeSelector()

Calculate the start- and end timestamp

protected setStartAndEndTimeFromTimeSelector(Constraint $constraint) : void
Parameters
$constraint : Constraint

setViewConfiguration()

protected setViewConfiguration(ViewInterface $view) : void
Parameters
$view : ViewInterface
Internal

only to be used within Extbase, not part of TYPO3 Core API.


        
On this page

Search results