-
Notifications
You must be signed in to change notification settings - Fork 120
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
Feature/uri_parsing #22
Conversation
Thanks, looks great! There are a few things I would modify.
|
@dwbutler Okay great, I can do those updates. |
…ans of configuration
I made the update from accepting the raw url I had one question about the uri = ENV['LOGSTASH_URI'] || opts[:uri] or uri = opts[:uri] || ENV['LOGSTASH_URI'] |
Hm... I think I would expect options passed in to take precedence over the environment. (option number 2) |
I think I actually prefer not having the environment variable hardcoded into the gem. I would rather use the new LogStashLogger::Device.new(uri: ENV['LOGSTASH_URI']) This way the user has the flexibility to determine their own fallback policy. For example in our production environment we want All this is leading me to believe, it's better left up to the user to define the needed behavior. This -- Arron |
That makes sense. Only the user really knows what environment variable they want to store configuration in. Besides, you might have multiple logstash configurations defined. |
One more thing - if the URI is invalid, it should probably just raise the exception so the problem is easier to notice and fix. I would be confused if my URI configuration were silently ignored and the default device were configured instead. |
@dwbutler Yah, I think you're right. PR is updated with that change. |
Awesome, thanks! |
@dwbutler This PR impliments
uri_config
parsing as discussed here #19