Skip to content

Configure Exception storage #88

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

Closed
MBoretto opened this issue Feb 4, 2016 · 12 comments
Closed

Configure Exception storage #88

MBoretto opened this issue Feb 4, 2016 · 12 comments

Comments

@MBoretto
Copy link
Collaborator

MBoretto commented Feb 4, 2016

It would be fine to add a method to enable and disable exception log and also to configure the path of the file.

@noplanman
Copy link
Member

Functionality for this is already outlined in the README, we just need to implement it properly.

@akalongman Was this code already in the project at some point and then removed?

Also, this should include verbosity, which would need more details as to what levels there will be and what is logged in each level.

@noplanman
Copy link
Member

Should the exceptions be saved in the same file as the normal logs?

I was thinking that it might make sense to leave the exception logging as it is, so that we can simply ask somebody who is having issues, to post the file TelegramException.log from the root directory.

What do you think?

@christianromeni
Copy link

Exceptions should not be logged to the same file..

@MBoretto
Copy link
Collaborator Author

Thank for the suggestion @christianromeni ! We plan to implement this in the next release 0.30

@ivanbaldo
Copy link

I don't understand why exception logging is required.
Shouldn't users just do a try catch block and log themselves?

@MBoretto
Copy link
Collaborator Author

@ivanbaldo can you show me an example?

@ivanbaldo
Copy link

In https://github.com/akalongman/php-telegram-bot/blob/master/examples/hook.php there is a catch block and it suggests people to log them there.
We are using that example and what we get is duplicated logs of the same exceptions (but we use SysLog instead, so in production we just comment out the file_put_contents() call).

@MBoretto
Copy link
Collaborator Author

@ivanbaldo Thanks for point this out, you are right. Feel free to open a pull request to fix it!

@ivanbaldo
Copy link

I was going to work into this but found this commit b1184d8 that I think deals with this issue.
So, should I delete all that code or someone just closes this issue as solved?
I am confused heh :-).

@MBoretto
Copy link
Collaborator Author

Yes that commit deals with it, you pointed out that the exception file is not the proper place where you have to put the log, so you can move the code in the try catch

@ivanbaldo
Copy link

So, this issue should be closed then, commit b1184d8 makes the exception storage optional and configurable.
Maybe I am missing something?
Thanks a lot!!!

@MBoretto
Copy link
Collaborator Author

closing thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants