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

use tailhead instead of tailer so as to handle rotating logs #29

Merged
merged 5 commits into from
Nov 16, 2018

Conversation

fgregg
Copy link
Contributor

@fgregg fgregg commented Nov 14, 2018

The current version of tailer does not follow the name of a file, it follows a file descriptor. This means that if you rotate the log files, sentrylogs will not see any of the new information in the new file.

This PR six8/pytailer#12 adds code into the tailer's follow method to change the behavior to follow a filename.

This PR swaps out the tailing dependency from tailer to tailhead in order to take advantage of tailhead ability to follow a filename.

@mdgart
Copy link
Owner

mdgart commented Nov 14, 2018

@fgregg linters are failing, can you take a look?

@fgregg
Copy link
Contributor Author

fgregg commented Nov 14, 2018

pip has removed installing from dependency links by default. I'll wait a couple of days to see if the maintainers of tailer want to bring in that PR. If they don't I'll get a version with log rotation on pypi and revisit this PR.

@fgregg fgregg changed the title use version of tailer that can handle rotation of logs [WIP] use version of tailer that can handle rotation of logs Nov 14, 2018
@fgregg
Copy link
Contributor Author

fgregg commented Nov 14, 2018

I think that Pipfile and Pipfile.lock will need be updated, but I'm not really familiar with those files. attn @bittner

self.params,
self.site,
self.logger)
if line is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simply

if line:

... which is pythonic. Also, an empty line wouldn't need to be parsed, right?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think an empty line could be important to parse. Empty lines are often used as separators. Not used that way for nginx, but this part of the code is not nginx specific.

@bittner
Copy link
Collaborator

bittner commented Nov 14, 2018

Re Pipfile, the line with tailer needs to be updated accordingly (i.e. with tailhead and its minimum version or version range, if that is known). Same goes for requirements.txt, as long as we have both.

  1. requirements.txt
  2. Pipfile

Afterwards, run pipenv update to regenerate Pipfile.lock, and put everything under version control.

@fgregg fgregg changed the title [WIP] use version of tailer that can handle rotation of logs use tailhead instead of tailer so as to handle rotating logs Nov 15, 2018
@fgregg
Copy link
Contributor Author

fgregg commented Nov 15, 2018

Let me decide what you want to do with falsy lines. Otherwise I think this is good to go @mdgart

@mdgart
Copy link
Owner

mdgart commented Nov 16, 2018

ok, I'm merging it

@mdgart mdgart merged commit 1bff3f2 into mdgart:master Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants