1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
<?php
/**
* @file
* Install, update and uninstall functions for the dblog module.
*/
/**
* Implements hook_schema().
*/
function dblog_schema(): array {
$schema['watchdog'] = [
'description' => 'Table that contains logs of all system events.',
'fields' => [
'wid' => [
'type' => 'serial',
'not null' => TRUE,
'size' => 'big',
'description' => 'Primary Key: Unique watchdog event ID.',
],
'uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {users}.uid of the user who triggered the event.',
],
'type' => [
'type' => 'varchar_ascii',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Type of log message, for example "user" or "page not found."',
],
'message' => [
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
'description' => 'Text of log message to be passed into the t() function.',
],
'variables' => [
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
],
'severity' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'The severity level of the event; ranges from 0 (Emergency) to 7 (Debug)',
],
'link' => [
'type' => 'text',
'not null' => FALSE,
'description' => 'Link to view the result of the event.',
],
'location' => [
'type' => 'text',
'not null' => TRUE,
'description' => 'URL of the origin of the event.',
],
'referer' => [
'type' => 'text',
'not null' => FALSE,
'description' => 'URL of referring page.',
],
'hostname' => [
'type' => 'varchar_ascii',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Hostname of the user who triggered the event.',
],
'timestamp' => [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp of when event occurred.',
'size' => 'big',
],
],
'primary key' => ['wid'],
'indexes' => [
'type' => ['type'],
'uid' => ['uid'],
'severity' => ['severity'],
],
];
return $schema;
}
/**
* Implements hook_update_last_removed().
*/
function dblog_update_last_removed(): int {
return 10101;
}
|