We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fddafd5 commit 6820444Copy full SHA for 6820444
src/LogTypeRegistrar.php
@@ -94,7 +94,7 @@ public function guessTypeFromFirstLine(LogFile|string $textOrFile): ?string
94
95
public function guessTypeFromFileName(LogFile $file): ?string
96
{
97
- if (str_contains($file->name, 'laravel')) {
+ if ($this->isPossiblyLaravelLogFile($file->name)) {
98
return LogType::LARAVEL;
99
} elseif (str_contains($file->name, 'php-fpm')) {
100
return LogType::PHP_FPM;
@@ -110,4 +110,10 @@ public function guessTypeFromFileName(LogFile $file): ?string
110
111
return null;
112
}
113
+
114
+ protected function isPossiblyLaravelLogFile(string $fileName): bool
115
+ {
116
+ return $fileName === 'laravel.log'
117
+ || preg_match('/laravel-\d{4}-\d{2}-\d{2}\.log/', $fileName);
118
+ }
119
0 commit comments