You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when you do that, all of your Rails standard debug logging goes away. Digging in, I see that Google::Apis assigns its logger to the Rails.logger if it's defined.
This seems like a strange choice and almost never the right answer.
I realize that the workaround is to construct a new Logger and assign it to Google::Apis.logger -- but that should be documented as the proper way to adjust logging
Or perhaps the default should be to use the $stdout logger and Rails users can choose to pollute their Rails log file by reassigning the logger accordingly
Oh, how I miss Log4j :-)
The text was updated successfully, but these errors were encountered:
Unfortunately I don't think I can change this behavior until the next major bump since there could be people expecting/relying on the current behavior. That said, I'll update the docs to make this clearer.
If it helps, I'd be willing to add a simpler mechanism to turn this on/off (albeit default to on) like an environment variable or something along those lines.
I think an option (supporting both ENV or explicit Google::Apis method) for specifying what level to dump payloads would be best .. and yeah, it could default to DEBUG but you could specify NONE if you want to shut it off (not my preference since most client libraries don't enable this level of tracing by default .. but if it's really necessary for backwards compat, I understand)
My Rails log file is overflowing with the payload of every API response from the GMail v1 API
The docs here suggest setting your level to INFO to silence the output:
https://developers.google.com/api-client-library/ruby/guide/logging
But when you do that, all of your Rails standard debug logging goes away. Digging in, I see that Google::Apis assigns its logger to the Rails.logger if it's defined.
This seems like a strange choice and almost never the right answer.
I realize that the workaround is to construct a new Logger and assign it to Google::Apis.logger -- but that should be documented as the proper way to adjust logging
Or perhaps the default should be to use the $stdout logger and Rails users can choose to pollute their Rails log file by reassigning the logger accordingly
Oh, how I miss Log4j :-)
The text was updated successfully, but these errors were encountered: