Open erikaxel opened 4 years ago
Hi, I see that this question has been added the type question. I don't really think this is a question, it is a feature request. (Some would even call it a bug given that you would expect the same result if you run pure Ruby or with the Rails autoloader)
Is your feature request related to a problem? Please describe. google-cloud-logging supports config from the environment keys GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_KEYFILE_JSON. If these are set the simple example
works perfectly. However, the Rails-part (in google/cloud/logging/rails.rb) does not support this. We use these ENV variables, and in particular there we have no .json file with the credentials, they are stored in the ENV variable GOOGLE_CLOUD_KEYFILE_JSON.
Describe the solution you'd like That the Rails autoloading supports GOOGLE_CLOUD_KEYFILE_JSON and GOOGLE_CLOUD_PROJECT if set.
Describe alternatives you've considered I could lift the code out and make my own code that sets the default logger, or I could write the contents of GOOGLE_CLOUD_KEYFILE_JSON to a file and pass in that as param. Both seem hackish and it is strange that the library both supports and does not support using GOOGLE_CLOUD_KEYFILE_JSON.