Changeset 475 for trunk/lib/App.inc.php
- Timestamp:
- Apr 26, 2014 3:04:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r468 r475 311 311 */ 312 312 313 // Skip session for some user agents.314 if (preg_match('/Atomz|ApacheBench|Wget/i', getenv('HTTP_USER_AGENT'))) {315 $this->setParam(array('enable_session' => false));316 }317 318 313 // Skip sessions if disabled or automatically skip if run in a CLI script. 319 314 if (true === $this->getParam('enable_session') && !defined('_CLI')) { … … 657 652 'type' => $this->logPriorityToString($priority), 658 653 'file:line' => "$file : $line", 659 'url' => mb_substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 1 28),654 'url' => mb_substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 1024), 660 655 'message' => $message 661 656 ); 657 // Here's a shortened version of event data. 658 $event_short = $event; 659 $event_short['url'] = truncate($event_short['url'], 120); 660 662 661 663 662 // FILE ACTION 664 663 if (false !== $this->getParam('log_file_priority') && $priority <= $this->getParam('log_file_priority')) { 665 $event_str = '[' . join('] [', $event ) . ']';664 $event_str = '[' . join('] [', $event_short) . ']'; 666 665 error_log(mb_substr($event_str, 0, 1024) . "\n", 3, $this->getParam('log_directory') . '/' . $this->getParam('log_filename')); 667 666 } … … 683 682 $hostname = (isset($_SERVER['HTTP_HOST']) && '' != $_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : php_uname('n'); 684 683 $subject = sprintf('[%s %s]', $hostname, $priority); 685 $sms_msg = sprintf('%s [%s:%s]', mb_substr($event ['message'], 0, 64), basename($file), $line);684 $sms_msg = sprintf('%s [%s:%s]', mb_substr($event_short['message'], 0, 64), basename($file), $line); 686 685 $headers = 'From: ' . $this->getParam('site_email'); 687 686 mb_send_mail($this->getParam('log_to_sms_address'), $subject, $sms_msg, $headers); … … 695 694 // Restore original locale. 696 695 setlocale(LC_TIME, $locale); 696 697 unset($event, $event_short); 697 698 698 699 return true;
Note: See TracChangeset
for help on using the changeset viewer.