Class: SnapDeploy::Provider::Heroku::API::LogDrain
- Inherits:
-
Object
- Object
- SnapDeploy::Provider::Heroku::API::LogDrain
- Defined in:
- lib/snap_deploy/provider/heroku/api.rb
Overview
[Log drains](devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some addons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.
Instance Method Summary collapse
-
#create(app_id_or_app_name, body) ⇒ Object
Create a new log drain.
-
#delete(app_id_or_app_name, log_drain_id_or_log_drain_url) ⇒ Object
Delete an existing log drain.
-
#info(app_id_or_app_name, log_drain_id_or_log_drain_url) ⇒ Object
Info for existing log drain.
-
#initialize(client) ⇒ LogDrain
constructor
A new instance of LogDrain.
-
#list(app_id_or_app_name) ⇒ Object
List existing log drains.
Constructor Details
#initialize(client) ⇒ LogDrain
Returns a new instance of LogDrain.
977 978 979 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 977 def initialize(client) @client = client end |
Instance Method Details
#create(app_id_or_app_name, body) ⇒ Object
Create a new log drain.
985 986 987 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 985 def create(app_id_or_app_name, body) @client.log_drain.create(app_id_or_app_name, body) end |
#delete(app_id_or_app_name, log_drain_id_or_log_drain_url) ⇒ Object
Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on.
993 994 995 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 993 def delete(app_id_or_app_name, log_drain_id_or_log_drain_url) @client.log_drain.delete(app_id_or_app_name, log_drain_id_or_log_drain_url) end |
#info(app_id_or_app_name, log_drain_id_or_log_drain_url) ⇒ Object
Info for existing log drain.
1001 1002 1003 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 1001 def info(app_id_or_app_name, log_drain_id_or_log_drain_url) @client.log_drain.info(app_id_or_app_name, log_drain_id_or_log_drain_url) end |
#list(app_id_or_app_name) ⇒ Object
List existing log drains.
1008 1009 1010 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 1008 def list(app_id_or_app_name) @client.log_drain.list(app_id_or_app_name) end |