Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $text = $_GET['errorLog'];
- $myRegex = "/\s*Exception\s+in\s*thread\s+\"[^\"]+\s*\"\s*java.([^\:]+)\s*\:\s*\d+\s*at\s+([^\(]+)\s*\(\s*([^\)]+)\s*\)/m";
- preg_match_all($myRegex, $text, $result);
- echo "<ul>";
- for($i = 0; $i < count($result[0]) ;$i++) {
- $getFullErrorType = explode('.', $result[1][$i]);
- $errorType = $getFullErrorType[count($getFullErrorType) - 1];
- $getFunction = explode('.', $result[2][$i]);
- $function = $getFunction[count($getFunction) - 1];
- $getLineAndFile = explode(":", $result[3][$i]);
- $file = $getLineAndFile[0];
- $line = $getLineAndFile[1];
- echo "<li>line <strong>" .htmlspecialchars($line) . "</strong> - ";
- echo "<strong>" . htmlspecialchars($errorType) . "</strong> in ";
- echo "<em>" . $file . ":" . $function . "</em></li>";
- }
- echo "</ul>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement