papertrail / papertrail-cli

Command-line client for Papertrail hosted syslog & app log management service
http://papertrailapp.com/
MIT License
426 stars 46 forks source link

Suggestion: Allow ./.papertrail config #65

Closed DannyBen closed 8 years ago

DannyBen commented 8 years ago

Hi,

Perhaps an easy to implement and non breaking feature could be to first look for a .papertrail file in the current directory, and if found, use it as the config source rather than the one in the home directory?

I know of the --configfile PATH argument, but it is less convenient for day to day use.

Having the dotfile config would allow to easily have multiple accounts connected, and have a config file per project.

EDIT:

It seems like you already support it...

It should be mentioned in the README :)

troy commented 8 years ago

Interesting idea. What led you to want/need >1 config files? I'd welcome whatever you're comfortable sharing about your target use.

On Thu, Jan 14, 2016, at 12:10 PM, Danny Ben Shitrit wrote:

Hi,

Perhaps an easy to implement and non breaking feature could be to first look for a .papertrail file in the current directory, and if found, use it as the config source rather than the one in the home directory?

I know of the --configfile PATH argument, but it is less convenient for day to day use.

Having the dotfile config would allow to easily have multiple accounts connected, and have a config file per project.

— Reply to this email directly or view it on GitHub[1].

Links:

  1. https://github.com/papertrail/papertrail-cli/issues/65
DannyBen commented 8 years ago

Well - target use is simple:

I am using Papertrail in two separate situations - my work related projects and my personal projects. So even if Papertrail (the website) supports (or will support) multiple accounts with one API token, it would still not provide a solution for me, since I want to separate accounts by design.

I guess anyone who is working in more than one "contexts" would be able to use it.

Another benefit, is that it can (if the user wants) be sort of like any other config file (e.g. .gitignore) and be checked into the repository for the entire team to use. Although I understand you might want to discourage such behavior and have each user use their own API key.

troy commented 8 years ago

Thanks, @DannyBen, that helps a lot. It's one thing to see a potential use for something (I have too many of those!), and another to personally have a situation which requires or would be helped by it. This is obviously the latter :)

It sounds like this exists already. I didn't know it either and I probably participated in that implementation decision :) As of a few minutes ago, it's documented in the readme as you suggested: https://github.com/papertrail/papertrail-cli#multiple-api-tokens

Thanks!

DannyBen commented 8 years ago

Excellent, and great documentation. I am using this feature and it works as expected. Just lovely.