-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help setting up log for Laravel? #42
Comments
Found describing log format for another tools for symfony logs (similar to laravel) https://github.com/n-educatio-pl/logstash-symfony-pattern/blob/master/patterns/symfony
|
Try this: |
@atamansv Thanks for the attempt, it looks like it should work, unfortunately though it doesn't seem to be matching anything. Not too sure why as it looks like it should. |
@dcdiogo pretty sure that's going to act super strange on stacktraces in the log though yeah? |
yeah, unfortunately, but, like I said on other thread, not the best, but work in almost cases (I use for Laravel, and it prints colored first line os stack trace only, witch is the word ERROR, WARNING, INFO, etc) |
I used what @dcdiogo wrote, with these changes: These are crude but quite fast on my Ubuntu 18.04, PhpStorm 2018.3 |
Log Format Message pattern: |
Try methods provided above, not work in my PhpStorm 2019.1.3 Build #PS-191.7479.51 Ideolog v191.0.12.0 |
I can't use them in PhpStorm 2019 ... Any new suggestion ? |
same here. any help? |
+1 |
Please use the reaction button instead of spamming us all. |
I'm using Laravel-Log-Enhancer to add extra info to my logs. Format with enhanced logs:
Format without:
Patterns:
|
To update this here, because I just stumbled upon this. here is what I use in Laravel 6 to filter the default laravel.[DATE].log: Message pattern: this leaves the groups: Time capture: 2 As for the patterns:
|
I set all the settings exactly the same as @makuro , but the error "Log format not recognized" does not disappear |
@mvalitov I see in your screenshot you have a full debug output including the stack trace. This is what keeps the error appearing. It needs a specific amount of occurances within a couple of lines to be recognized as a log format. Try removing all stack trace and have a look at it again, the error message should disappear. You have different kind of options to populate the informations from within laravel. You can set up your own channel: https://laravel.com/docs/6.x/logging#building-log-stacks or you update |
@makuro thank you very much, I set up the log output format, but it is still not recognized |
@mvalitov you Need at least 5 recognized lines |
Any one figure out the wordress debug log format? [14-Apr-2020 21:56:03 UTC] /var/www/html/wp-content/themes/themename/functions.php/287: |
@joseffb-mla Please make your own new issue for that. |
it is still required to have 5 lines in the beginning of the file, right? it is not enough to find the pattern 5 times in the file. it has to be the first 5 lines? or are 5 matches in the first 20 lines ok? where I'm using ideolog? in the IDE so my local logs are rotated on a daily base and usually start with:
IMO it does not make sense to limit it to a specific amount of lines. As this is only checked once the file get's opened it we could run it for the first 20 kb maybe.. and instead of searching for the 5 lines we could have a rank and say: "Monolog" matched two times, "JLogger" matched 1 times, others didn't match - lets use monolog and show a warning "switch log format" |
I figured it out based on the Laravel example. Thanks!
…On Wed, Apr 15, 2020 at 3:56 AM Jez McKean ***@***.***> wrote:
@joseffb-mla <https://github.com/joseffb-mla> Please make your own new
issue for that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKXFTEZMGBVRYZEJHGBF76LRMVSBBANCNFSM4FNUGILQ>
.
|
Hello everyone, |
I went through all of them, none of them appear to work. Have you found anything since asking? |
Hey, |
I don't know what they did. But I removed that plugin and have a good view on log files now. |
the results here are for Laravel 6 and below. At the moment, this is 2 major versions behind. in my experience the main issue is, that there are not enough lines available for the color to show up. you would need at least 5 consecutive lines for the plugin to trigger. try creating a file with 5 lines without linebreaks between and see if the plugin lights up the colors. if not, please provide a bit more intel here. |
The logging format hasn't changed too much since then as far as I know. But I could be wrong. Anyways, I ended up spending some time editing / making my own regex and everything works fine now. Although I do still get the notification about Ideolog not recognizing the format, which I just ignore. |
@iderkzen Can u please share your work with us?? |
@mehranabi Here is the setup I'm currently using. It seems to work for all use-cases I've tried so far. Log Format
PatternsCritical: I would love to give credit where credit is due, but I can't remember exactly which parts were edited and which were found somewhere on the internet (maybe even in this issue). |
I want to know how your log file can automatically wrap when the # sign is encountered. Can you help me? |
Added in #168. Will be released in the next version. Thanks for your feedback! |
Hey there!
Great plugin, super useful for quickly viewing log files...
Well it was. But it seems Laravel doesn't match the default provided formats anymore so I was hoping we could get some help.
The general format looks like this:
Of note is that the new log message always starts with
[{date} {time}] {category}.{severity}:
Also, there are some lines that start with a
[
that are not new entries e.g.[stacktrace]
.Another example of an info log entry would be:
So, I'd love some assistance in what patterns I should use to support this format?
The text was updated successfully, but these errors were encountered: