Skip to content
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

Add logging feature with different logging handlers #663

Open
1 task
circulon opened this issue Jun 7, 2022 · 5 comments · May be fixed by #718
Open
1 task

Add logging feature with different logging handlers #663

circulon opened this issue Jun 7, 2022 · 5 comments · May be fixed by #718
Labels
feature request Requesting a feature that does not exist yet Next Major Only

Comments

@circulon
Copy link
Contributor

circulon commented Jun 7, 2022

Is your feature request related to a problem?

Kind of.
Currently there is no way to log any form of message (exceptions, errors or debug info to persistent storage for later evaluation.

This is a problem in production scenarios where you want to store the message for evaluation and bug reproduction/confirmation.

What do we currently have to do now?

There is no easy out of the box way to do this.

Describe the solution you'd like

Possibly a LoggingProvider that can register handler/s
Each handler listens for (or processes only) specific log level messages in a specific way

eg
Each handler would receive the message as by the logging module (eg logging.info()).
The handler would then process the message in whatever way is designed for.
ie send to a file, add a row in a db table, custom handler to send to an external service via api, etc.

This offers maximum flexibility and configuration for logging messages of any type regardless of environment or deployment strategy.

Describe alternatives you've considered

Is there something I have missed with this?

Would this be a breaking change ?

  • Yes

Anything else ?

No response

@girardinsamuel
Copy link
Contributor

There was a masonite-logging package in Masonite < 4. For Masonite 4 we have chosen to rely on the logging package directly.

However, having a LoggingProvider with different logging handlers - integrated into Masonite core - would be nice. This is a feature I was looking to add, but we did not put much priority on it for now, as we have planned some other features for Masonite 5 and the general ecosystem.

We will likely add this feature later, but for now we won't have time to implement it for Masonite 4 (I would be glad to help on this if you want to contribute to it).

@josephmancuso
Copy link
Member

Yes I also support this feature. We can add a few different handlers as we had before:

  • Python File (would use python logging module and just log to a file)
  • Rollbar or Sentry or some kind of third party logging solution

@josephmancuso
Copy link
Member

Can take a look at what masonite-logging had and replicate those features since that package was pretty complete for M3

@josephmancuso josephmancuso added feature request Requesting a feature that does not exist yet and removed enhancement labels Jun 7, 2022
@girardinsamuel girardinsamuel changed the title Logging messages to persistent storage Add logging feature with different logging handlers Jun 9, 2022
@circulon
Copy link
Contributor Author

Can take a look at what masonite-logging had and replicate those features since that package was pretty complete for M3

That Sounds great!.
Thanks

In the mean time I have added a basic LoggingProvider to my M4 project to include a catchall and configuration based on the context the logging is working in (AWS Lambda or local development)

But yeah sounds like a great idea to reuse/tweak the M3 provider

@goophps
Copy link

goophps commented Jun 18, 2022

I also need this feature. Hope it gets integrated.

@girardinsamuel girardinsamuel linked a pull request Oct 10, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requesting a feature that does not exist yet Next Major Only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants