Closed Andrewsuares closed 5 years ago
Hi @Andrewsuares
I've not experienced that sort of error before. However, I need you to please do two things for me.
First, try using PHP 7.2 and observe the outcome? I'm suspecting it might have to do with PHP version.
Secondly, Please dig through the raw stack trace and pinpoint the parameters supplied to the preg_match() function that led to the crash
+1 for stating your PHP and CI versions. I'll be expecting your feedback.
Cheers.
Hello Seun, I've deployed CI on a large project and we're good with PHP 7.3. Going to be a bit hard for me to test 7.2. How do I enable to raw stack trace?
Please look at the link below. The preg function was updated in PHP 7.3. https://github.com/sunra/php-simple-html-dom-parser/issues/64
Ha I see @Andrewsuares The package needs an update. I'll add it to the pipeline but can't say definitely when it'll be fixed.
In case you fix it in your code, please be so kind as to create a PR for it here as well. Cheers
Easy fix: you should escape "-" character. Fix at line 30 from this: const LOG_LINE_START_PATTERN = "/((INFO)|(ERROR)|(DEBUG)|(ALL))[\s-\d:]+(-->)/"; to this const LOG_LINE_START_PATTERN = "/((INFO)|(ERROR)|(DEBUG)|(ALL))[\s-\d:]+(-->)/";
;)
I think also the same problem is at line 31: from this: const LOG_DATE_PATTERN = "/(\d{4,}-[\d-:]{2,})\s([\d:]{2,})/"; to this: const LOG_DATE_PATTERN = "/(\d{4,}-[\d-:]{2,})\s([\d:]{2,})/";
Another fix:
line 35 from this <a href="?f=<?= base64_encode($file); ?>" to this <a href="<?php echo base_url(); ?>logs/?f=<?= base64_encode($file); ?>" or you get path error if defined a base path for css/js....
Hello! Fixed bug: https://github.com/SeunMatt/codeigniter-log-viewer/pull/14
Hello @Andrewsuares issue has been fixed in the new version release version 1.1.2
I finally got down to installing this update. Works brilliantly. The layout and the ability to see logs so easily just makes it great. Thank You for this!!
PS: Maybe you could do one to view the apache error log files :)
Hello, Any idea what could be wrong here?
CI_VERSION = '3.1.10'; PHP 7.3.4
A PHP Error was encountered
Severity: Warning
Message: preg_match(): Compilation failed: invalid range in character class at offset 33
Filename: src/CILogViewer.php
Line Number: 384
Backtrace:
File: /public_html/api/vendor/seunmatt/codeigniter-log-viewer/src/CILogViewer.php Line: 384 Function: preg_match
File: /public_html/api/vendor/seunmatt/codeigniter-log-viewer/src/CILogViewer.php Line: 285 Function: getLogLineStart
File: /public_html/api/vendor/seunmatt/codeigniter-log-viewer/src/CILogViewer.php Line: 172 Function: processLogs
File: /public_html/api/application/modules/f_cp/controllers/F_cp.php Line: 116 Function: showLogs