Craft Activity (2.x)

Logs extends Component
in package

Table of Contents

REQUEST_CONSOLE  = 'console'
REQUEST_CP  = 'cp'
REQUEST_SITE  = 'site'
REQUEST_YAML  = 'yaml'
deleteAllLogs()  : mixed
Delete all logs
deleteLog()  : mixed
Delete a log by id
deleteLogsByType()  : mixed
Deletes all logs related to some types and related to a target
deleteSiteLogs()  : mixed
Deletes all logs created for a site
deleteUserLogs()  : mixed
Deletes all logs created by a user
getChangedFieldById()  : ChangedField
Get a changed field by id
getCurrentRequest()  : string
Get current request descriptor
getLogsQuery()  : ActiveQuery
Get a filtered logs query
getPaginatedLogs()  : array<string|int, mixed>
Get paginated logs according to some filters
getUsedUsers()  : array<string|int, mixed>
Get all user used in database in all records
getUserLogs()  : array<string|int, mixed>
Get the latest logs for a user
runGc()  : mixed
Run garbage collection, delete all logs older than threshold
saveLog()  : bool
Saves a log

Constants

REQUEST_CONSOLE

public mixed REQUEST_CONSOLE = 'console'

REQUEST_CP

public mixed REQUEST_CP = 'cp'

REQUEST_SITE

public mixed REQUEST_SITE = 'site'

REQUEST_YAML

public mixed REQUEST_YAML = 'yaml'

Methods

deleteAllLogs()

Delete all logs

public deleteAllLogs() : mixed
Return values
mixed

deleteLog()

Delete a log by id

public deleteLog(int $id) : mixed
Parameters
$id : int
Return values
mixed

deleteLogsByType()

Deletes all logs related to some types and related to a target

public deleteLogsByType(array<string|int, mixed> $types, string $target) : mixed
Parameters
$types : array<string|int, mixed>
$target : string
Tags
since
2.4.0
Return values
mixed

deleteSiteLogs()

Deletes all logs created for a site

public deleteSiteLogs(int $siteId) : mixed
Parameters
$siteId : int
Tags
since
2.4.0
Return values
mixed

deleteUserLogs()

Deletes all logs created by a user

public deleteUserLogs(User $user) : mixed
Parameters
$user : User
Return values
mixed

getCurrentRequest()

Get current request descriptor

public getCurrentRequest() : string
Return values
string

getLogsQuery()

Get a filtered logs query

public getLogsQuery(array<string|int, mixed> $filters[, string $orderBy = 'dateCreated desc' ]) : ActiveQuery
Parameters
$filters : array<string|int, mixed>
$orderBy : string = 'dateCreated desc'
Tags
since
2.3.0
Return values
ActiveQuery

getPaginatedLogs()

Get paginated logs according to some filters

public getPaginatedLogs(array<string|int, mixed> $filters[, int $perPage = 5 ][, string $orderBy = 'dateCreated desc' ]) : array<string|int, mixed>
Parameters
$filters : array<string|int, mixed>
$perPage : int = 5
$orderBy : string = 'dateCreated desc'
Return values
array<string|int, mixed>

getUsedUsers()

Get all user used in database in all records

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

getUserLogs()

Get the latest logs for a user

public getUserLogs(User $user[, int $limit = 10 ]) : array<string|int, mixed>
Parameters
$user : User
$limit : int = 10
Return values
array<string|int, mixed>

runGc()

Run garbage collection, delete all logs older than threshold

public runGc() : mixed
Return values
mixed

Search results