Ruby: Rails-Google Cloud-Client konfigurieren

Google Cloud-Clientauthentifizierung für Rails konfigurieren.

Weitere Informationen

Eine ausführliche Dokumentation, die dieses Codebeispiel enthält, finden Sie hier:

Codebeispiel

Ruby

Informationen zum Installieren und Verwenden der Clientbibliothek für Logging finden Sie unter Logging-Clientbibliotheken.

Richten Sie Standardanmeldedaten für Anwendungen ein, um sich bei Logging zu authentifizieren. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# Add this to config/environments/*.rb
Rails.application.configure do |config|
  # Stackdriver Logging specific parameters
  config.google_cloud.logging.project_id = "YOUR-PROJECT-ID"
  config.google_cloud.logging.keyfile    = "/path/to/service-account.json"
end

Nächste Schritte

Informationen zum Suchen und Filtern von Codebeispielen für andere Google Cloud-Produkte finden Sie im Google Cloud-Beispielbrowser.