Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Sane logging by default #32

Merged
merged 7 commits into from
Jul 29, 2015
Merged

Sane logging by default #32

merged 7 commits into from
Jul 29, 2015

Conversation

joshuafleck
Copy link

I was looking at all of our apps, and there is a lot of duplication when it comes to setting up rabbit_feed logging - I've changed rabbit_feed to use reasonable defaults for its logging, including rotating the logfile every 100MB up to 1GB.

@sparrovv @dawid-sklodowski @calo81 Could you please sign off?

I also removed some duplication with spec_helper requires.

Joshua Fleck added 5 commits July 29, 2015 08:51
With more verbose logging, the rabbit_feed.log will begin to fill up disk quickly.
This ensures that the rabbit_feed log will not consume more than 1GB of disk.
Logs to file if there is a log directory
Auto rotates the log file
This cleans up the spec files a bit by removing some duduplicate code
Will log to `log/rabbit_feed.log` using json formatting unless
otherwise specified.

def default_logger
if File.directory? 'log'
Logger.new('log/rabbit_feed.log', 10, 100.megabytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought you don't use parentheses ;-)

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, think of the bytes wasted by the unnecessary punctuation!

@sparrovv
Copy link
Contributor

Looks good to me, signed-off-by: @sparrovv

joshuafleck pushed a commit that referenced this pull request Jul 29, 2015
@joshuafleck joshuafleck merged commit b7aae83 into master Jul 29, 2015
@joshuafleck joshuafleck deleted the log_rotation branch July 29, 2015 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants