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
318d84e6
Commit
318d84e6
authored
Oct 19, 2000
by
Dries
Browse files
- extended and renamed drop's watchdog.
parent
11ee95da
Changes
1
Show whitespace changes
Inline
Side-by-side
includes/
l
og.inc
→
includes/
watchd
og.inc
View file @
318d84e6
...
...
@@ -5,12 +5,12 @@ function watchdog($level, $message) {
global
$user
;
### Perform query to add new log entry:
db_query
(
"INSERT INTO
l
og
s
(level, timestamp, user, message, hostname) VALUES (
$level
, '"
.
time
()
.
"', '"
.
addslashes
(
$user
->
id
)
.
"', '"
.
addslashes
(
$message
)
.
"', '"
.
getenv
(
"REMOTE_ADDR"
)
.
"')"
);
db_query
(
"INSERT INTO
watchd
og (level, timestamp, user, message,
location,
hostname) VALUES (
$level
, '"
.
time
()
.
"', '"
.
addslashes
(
$user
->
id
)
.
"', '"
.
addslashes
(
$message
)
.
"', '"
.
getenv
(
"SCRIPT_NAME"
)
.
"', '"
.
getenv
(
"REMOTE_ADDR"
)
.
"')"
);
### Periodically remove old log entries:
if
(
time
()
%
20
==
0
)
{
$timestamp
=
time
()
-
1209600
;
// 2 weeks
db_query
(
"DELETE FROM
l
og
s
WHERE timestamp <
$timestamp
"
);
db_query
(
"DELETE FROM
watchd
og WHERE timestamp <
$timestamp
"
);
}
}
...
...
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