Để 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.
Bạn có thể ghi lại các yêu cầu, phản hồi và thông báo tóm tắt được gửi đến Google Ads API bằng 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 ứng dụng cho Perl.
Cấp độ nhật ký
Thư viện sẽ ghi nhiều loại sự kiện vào nhiều cấp độ nhật ký. Khi phản hồi API thành công, bản tóm tắt sẽ được ghi vào nhật ký tại INFO và toàn bộ yêu cầu cũng như phản hồi sẽ được ghi vào nhật ký tại DEBUG. Đối với yêu cầu dẫn đến lỗi API, thông báo tóm tắt sẽ được ghi vào nhật ký tại WARN và yêu cầu cũng như phản hồi đầy đủ sẽ được ghi vào nhật ký tại INFO.
Loại nhật ký
Tên nhật ký
Cấp độ thành công
Cấp độ lỗi
TÓM TẮT
Google.Ads.GoogleAds.Summary
INFO (THÔNG TIN)
WARN (CẢNH BÁO)
CHI TIẾT
Google.Ads.GoogleAds.Detail
DEBUG (Gỡ lỗi)
INFO (THÔNG TIN)
Đối với các lỗi một phần, thông tin chi tiết về lỗi một phần sẽ được ghi vào nhật ký tại DEBUG.
Cấu hình
Thư viện ứng dụng sử dụng một lớp tuỳ chỉnh cho mọi mục đích ghi nhật ký và được hiển thị thông qua mô-đun GoogleAdsLogger. Lớp này cung cấp một cấu hình mặc định mà cả trình ghi nhật ký tóm tắt và chi tiết sẽ ghi vào các tệp tương đối trong thư mục logs trong thư mục HOME.
Tuy nhiên, bạn có thể ghi đè cấu hình mặc định bằng cách cung cấp tệp log4perl.conf trong thư mục HOME.
Bạn có thể bật/tắt tính năng ghi nhật ký bằng các phương thức sau:
Cho phép ghi nhật ký cho cả hai trình ghi nhật ký.
[[["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-09-05 UTC."],[[["\u003cp\u003eThe Google Ads API client library for Perl allows logging of requests, responses, and summaries using a custom or default logger.\u003c/p\u003e\n"],["\u003cp\u003eLogging levels include \u003ccode\u003eINFO\u003c/code\u003e, \u003ccode\u003eDEBUG\u003c/code\u003e, and \u003ccode\u003eWARN\u003c/code\u003e, used to categorize different event types like successes, failures, and partial failures.\u003c/p\u003e\n"],["\u003cp\u003eThe default logger configuration saves logs to the \u003ccode\u003elogs\u003c/code\u003e folder in your home directory, which can be customized by providing a \u003ccode\u003elog4perl.conf\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eLogging can be controlled through the \u003ccode\u003eGoogleAdsLogger\u003c/code\u003e module, allowing for enabling/disabling logging or more advanced customization.\u003c/p\u003e\n"]]],[],null,["# Logging\n\nRequests, responses, and summary messages made to the Google Ads API can be\nlogged with your own custom logger or the default logger in the client library\nfor Perl.\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\n| Log type | Log name | Success level | Failure level |\n|----------|------------------------------|---------------|---------------|\n| SUMMARY | Google.Ads.GoogleAds.Summary | INFO | WARN |\n| DETAIL | Google.Ads.GoogleAds.Detail | DEBUG | INFO |\n\nFor partial failures, the partial failure details will be logged at `DEBUG`.\n\nConfiguration\n-------------\n\nThe client library uses a custom class for all logging purposes and is exposed\nthrough the [GoogleAdsLogger](https://github.com/googleads/google-ads-perl/blob/HEAD/lib/Google/Ads/GoogleAds/Logging/GoogleAdsLogger.pm)\nmodule. This class provides a default configuration that both summary and detail\nloggers will log to relative files in the `logs` folder under your `HOME` directory.\nBut the default configuration can be overridden by providing a\n[log4perl.conf](https://github.com/googleads/google-ads-perl/blob/HEAD/log4perl.conf)\nfile in your `HOME` directory.\n\nLogging can be enabled/disabled using the following methods:\n\n- Enables logging for both loggers.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::enable_all_logging();\n\n- Disables the summary logging.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_summary_logging();\n\n- Disables the detail logging.\n\n Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_detail_logging();\n\nYou can use the methods of the `GoogleAdsLogger` class directly for even more\ncontrol over how requests are logged."]]