truncate file when logging to 255 chars so it gets into the db

This commit is contained in:
Isaac Connor 2021-02-09 14:23:15 -05:00
parent 9b3d423f3d
commit c2ac171811
1 changed files with 3 additions and 0 deletions

View File

@ -413,6 +413,9 @@ class Logger {
$message = $code.' ['.$string.']'; $message = $code.' ['.$string.']';
if ( $level <= $this->databaseLevel ) { if ( $level <= $this->databaseLevel ) {
if ( strlen($file) > 255 )
$file = substr($file, 0, 255);
try { try {
global $dbConn; global $dbConn;
$sql = 'INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )'; $sql = 'INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )';