Class: PlatformAPI::LogDrain

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

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

Constructor Details

#initialize(client) ⇒ LogDrain

Returns a new instance of LogDrain.



731
732
733
# File 'lib/platform-api/client.rb', line 731

def initialize(client)
  @client = client
end

Instance Method Details

#create(app_id_or_app_name, body) ⇒ Object

Create a new log drain.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



739
740
741
# File 'lib/platform-api/client.rb', line 739

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.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • log_drain_id_or_log_drain_url:

    unique identifier of this log drain or url associated with the log drain



747
748
749
# File 'lib/platform-api/client.rb', line 747

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.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • log_drain_id_or_log_drain_url:

    unique identifier of this log drain or url associated with the log drain



755
756
757
# File 'lib/platform-api/client.rb', line 755

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.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



762
763
764
# File 'lib/platform-api/client.rb', line 762

def list(app_id_or_app_name)
  @client.log_drain.list(app_id_or_app_name)
end