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

Generate and store logs #5

Open
alexdor opened this issue Oct 26, 2016 · 6 comments
Open

Generate and store logs #5

alexdor opened this issue Oct 26, 2016 · 6 comments

Comments

@alexdor
Copy link
Member

alexdor commented Oct 26, 2016

PfCounter should generate and store logs. I don't know if python has a proper implementation for storing app logs to system's logs. We could, probably, use logger though.

@wandeg
Copy link

wandeg commented Oct 26, 2016

The python logging module can be used to generate the logs.

@panagiks
Copy link
Contributor

@alexdor why write at the system logs? Also using logger will make it OS specific (as soon as we solve #4 the script will be able to run on any OS with Python installed). I've already implemented a basic logging mechanism for RSPET, we can take this to use it out of the box asap and once we get a bit of free time migrate to @wandeg 's suggestion of the logging module.

@alexdor
Copy link
Member Author

alexdor commented Oct 26, 2016

Because it's easier to manage logs, from a sysadmin's standpoint, when they are centralized. But keeping it platform agnostic is important so let's use your implementation.

@Canuteson
Copy link

It might also be better just to log to stdout. You can use logger as @panagiks suggested.

Then you decide where to send standard out when you run the script. This is commonly done in cron and init/upstart scripts. It makes the application not care where the logs go, which is a nice pattern.

@panagiks
Copy link
Contributor

@alexdor would it be easy for you to make a list of the things you think that should be logged?

@alexdor
Copy link
Member Author

alexdor commented Oct 28, 2016

Sure, when debugging flag is enabled, everything should be logged (published message as well as the verbose answer from the broker). When the flag is disabled, it should only log failures (unable to publish, connection refused, unable to log in etc.). Timestamps would be nice as well.

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