I develop a pretty big web application using laravel. Logging to a single file or daily files seems too messy for me.
My purpose is to create error logs which will be categorised and easy for retrieval to show on front-end to tech support. E.g. user entered wrong api-key, email, whatever.
P.S. Users don't always understand meaning of the error showed so they contact tech support.
Example for better understanding:
So if I have model relations:
User->hasMany->Project
and in some project appears an exception I want it to be written and related to the project. e.t.c. So I could do something like$some_project_model->logs()->get()
and tech support got all logs related to certain project.
What I have in my mind is separate table for logs which is related to certain Eloquent models. But to do so ExceptionHandler (which getting all the Exceptions) needs to know to which model an Exception is related to.
So how this can be implemented? Maybe I could assign certain ExceptionHandler to certain class?
I've found Eloquent logging guide and how to manually logging to separate files, but I need better.
Thank you for any suggestions.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire