hedera-web/rest/core/log.php

35 lines
650 B
PHP
Raw Normal View History

2016-07-22 20:00:27 +00:00
<?php
2018-05-23 10:14:20 +00:00
class Log extends Vn\Web\JsonRequest {
2016-09-06 14:25:02 +00:00
const PARAMS = [
'message'
,'file'
2016-09-06 14:25:02 +00:00
,'line'
,'location'
,'agent'
2016-09-06 14:25:02 +00:00
,'stack'
];
function run($db) {
if (!_ENABLE_DEBUG) return TRUE;
2018-05-23 10:14:20 +00:00
$user = isset($_SESSION['user']) ? $_SESSION['user'] : 'guest';
$message = $_REQUEST['message'];
$file = $_REQUEST['file'];
$line = $_REQUEST['line'];
$location = $_REQUEST['location'];
$agent = $_REQUEST['agent'];
$stack = $_REQUEST['stack'];
error_log(
"Javascript: $message in $file($line)"
."\nLocation: $location"
."\nAgent: $agent"
."\nUser: $user"
."\nStack: $stack"
);
2016-07-22 20:00:27 +00:00
return TRUE;
}
}