Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
354e0c1f
Commit
354e0c1f
authored
Jul 29, 2005
by
Steven Wittens
Browse files
-
#23651
: Display referrer info with watchdog messages.
parent
515f7b41
Changes
6
Hide whitespace changes
Inline
Side-by-side
database/database.mysql
View file @
354e0c1f
...
...
@@ -768,6 +768,7 @@ CREATE TABLE watchdog (
severity tinyint(3) unsigned NOT NULL default '0',
link varchar(255) NOT NULL default '',
location varchar(128) NOT NULL default '',
referer varchar(128) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
PRIMARY KEY (wid)
...
...
database/database.pgsql
View file @
354e0c1f
...
...
@@ -762,6 +762,7 @@ CREATE TABLE watchdog (
severity smallint NOT NULL default '0',
link varchar(255) NOT NULL default '',
location varchar(128) NOT NULL default '',
referer varchar(128) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
PRIMARY KEY (wid)
...
...
database/updates.inc
View file @
354e0c1f
...
...
@@ -117,7 +117,8 @@
"2005-05-10"
=>
"update_138"
,
"2005-05-11"
=>
"update_139"
,
"2005-05-12"
=>
"update_140"
,
"2005-05-22"
=>
"update_141"
"2005-05-22"
=>
"update_141"
,
"2005-07-29"
=>
"update_142"
);
function
update_32
()
{
...
...
@@ -2511,6 +2512,12 @@ function update_141() {
return
$ret
;
}
function
update_142
()
{
$ret
=
array
();
$ret
[]
=
update_sql
(
"ALTER TABLE
{
watchdog
}
ADD COLUMN referer varchar(128) NOT NULL"
);
return
$ret
;
}
function
update_sql
(
$sql
)
{
$edit
=
$_POST
[
"edit"
];
$result
=
db_query
(
$sql
);
...
...
includes/bootstrap.inc
View file @
354e0c1f
...
...
@@ -739,7 +739,7 @@ function request_uri() {
*/
function
watchdog
(
$type
,
$message
,
$severity
=
WATCHDOG_NOTICE
,
$link
=
NULL
)
{
global
$user
;
db_query
(
"INSERT INTO
{
watchdog
}
(uid, type, message, severity, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', %d)"
,
$user
->
uid
,
$type
,
$message
,
$severity
,
$link
,
request_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
time
());
db_query
(
"INSERT INTO
{
watchdog
}
(uid, type, message, severity, link, location,
referer,
hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s',
'%s',
%d)"
,
$user
->
uid
,
$type
,
$message
,
$severity
,
$link
,
request_uri
(),
referer_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
time
());
}
/**
...
...
modules/watchdog.module
View file @
354e0c1f
...
...
@@ -141,6 +141,7 @@ function watchdog_event($id) {
$output
.
=
' <tr><th>'
.
t
(
'Date'
)
.
'</th><td>'
.
format_date
(
$watchdog
->
timestamp
,
'large'
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'User'
)
.
'</th><td>'
.
format_name
(
$watchdog
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Location'
)
.
"</th><td>"
.
l
(
$watchdog
->
location
,
$watchdog
->
location
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Referrer'
)
.
"</th><td>"
.
l
(
$watchdog
->
referer
,
$watchdog
->
referer
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Message'
)
.
"</th><td>
$watchdog->message
</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Severity'
)
.
'</th><td>'
.
$severity
[
$watchdog
->
severity
]
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Hostname'
)
.
"</th><td>
$watchdog->hostname
</td></tr>"
;
...
...
modules/watchdog/watchdog.module
View file @
354e0c1f
...
...
@@ -141,6 +141,7 @@ function watchdog_event($id) {
$output
.
=
' <tr><th>'
.
t
(
'Date'
)
.
'</th><td>'
.
format_date
(
$watchdog
->
timestamp
,
'large'
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'User'
)
.
'</th><td>'
.
format_name
(
$watchdog
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Location'
)
.
"</th><td>"
.
l
(
$watchdog
->
location
,
$watchdog
->
location
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Referrer'
)
.
"</th><td>"
.
l
(
$watchdog
->
referer
,
$watchdog
->
referer
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Message'
)
.
"</th><td>
$watchdog->message
</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Severity'
)
.
'</th><td>'
.
$severity
[
$watchdog
->
severity
]
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Hostname'
)
.
"</th><td>
$watchdog->hostname
</td></tr>"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment