Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của Google Ads trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các yêu cầu, phản hồi và thông báo tóm tắt được gửi đến API Google Ads có thể được ghi vào trình ghi nhật ký tuỳ chỉnh của riêng bạn hoặc trình ghi nhật ký mặc định trong thư viện Ruby.
Cấp độ nhật ký
Thư viện sẽ ghi lại các loại sự kiện khác nhau vào cấp độ nhật ký khác nhau. Khi API phản hồi thành công, bản tóm tắt sẽ được ghi lại tại INFO, và toàn bộ yêu cầu cũng như nội dung phản hồi sẽ được ghi lại tại DEBUG. Đối với một yêu cầu dẫn đến lỗi API, thông báo tóm tắt sẽ được ghi tại WARN, đồng thời toàn bộ yêu cầu và phản hồi sẽ được ghi tại INFO.
Đối với lỗi một phần, thông tin chi tiết về lỗi một phần sẽ được ghi lại tại DEBUG.
Cấu hình
Bạn có thể định cấu hình trình ghi nhật ký trong cấu hình
google_ads_config.rb
của mình. Bạn có thể thiết lập trình ghi nhật ký mặc định bằng cách chỉ định các trường log_level và log_target, hoặc bạn có thể chỉ định hoàn toàn trình ghi nhật ký của riêng mình bằng cách chỉ định logger. Nếu bạn chỉ định logger, thì log_level và log_target sẽ bị bỏ qua.
Bạn cũng có thể chỉ định một trình ghi nhật ký sau khi tạo thực thể ứng dụng bằng client.logger=.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[[["\u003cp\u003eThe Google Ads API Ruby library allows logging of requests, responses, and summaries to custom or default loggers.\u003c/p\u003e\n"],["\u003cp\u003eDifferent log levels are used for successful responses (\u003ccode\u003eINFO\u003c/code\u003e, \u003ccode\u003eDEBUG\u003c/code\u003e) and errors (\u003ccode\u003eWARN\u003c/code\u003e, \u003ccode\u003eINFO\u003c/code\u003e, \u003ccode\u003eDEBUG\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eLogging can be configured through the \u003ccode\u003egoogle_ads_config.rb\u003c/code\u003e file using \u003ccode\u003elog_level\u003c/code\u003e, \u003ccode\u003elog_target\u003c/code\u003e, or a custom \u003ccode\u003elogger\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAfter client instantiation, the logger can be specified using \u003ccode\u003eclient.logger=\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Logging\n\nRequests, responses, and summary messages made to the Google Ads API can be\nlogged to your own custom logger or a default logger in the Ruby library.\n\nLog Levels\n----------\n\nThe library will log different types of events to different log levels. On a\nsuccessful API response, the summary will be logged at `INFO`, and the full\nrequest and responses will be logged at `DEBUG`. On a request that resulted in\nan API error, the summary message will be logged at `WARN` and the full request\nand response will be logged at `INFO`.\n\nFor partial failures, the partial failure details will be logged at `DEBUG`.\n\nConfiguration\n-------------\n\nThe logger can be configured as part of your\n[google_ads_config.rb](https://github.com/googleads/google-ads-ruby/blob/HEAD/google_ads_config.rb)\nconfiguration. You can set up a default logger by specifying the `log_level` and\n`log_target` fields, or you can specify your own logger entirely by specifying\n`logger`. If you specify `logger`, then `log_level` and `log_target` will be\nignored.\n\nYou can also specify a logger after instantiating the client using\n`client.logger=`."]]