लॉग इन हो रहा है
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google Ads API को भेजे गए अनुरोध, जवाब, और खास जानकारी वाले मैसेज को
Ruby लाइब्रेरी में आपके कस्टम लॉगर या डिफ़ॉल्ट लॉगर से लॉग किया जा सकता है.
लॉग लेवल
लाइब्रेरी, अलग-अलग तरह के इवेंट को अलग-अलग लॉग लेवल पर लॉग करेगी. एपीआई से मिला रिस्पॉन्स मिलने पर, खास जानकारी को INFO
पर लॉग किया जाएगा. साथ ही, सभी अनुरोधों और जवाबों को DEBUG
पर लॉग किया जाएगा. एपीआई से जुड़ी गड़बड़ी के अनुरोध पर, खास जानकारी वाले मैसेज को WARN
पर लॉग किया जाएगा. साथ ही, पूरे अनुरोध और रिस्पॉन्स को INFO
पर लॉग किया जाएगा.
अगर कुछ हद तक गड़बड़ी हुई है, तो पूरी गड़बड़ी की जानकारी को DEBUG
पर लॉग किया जाएगा.
कॉन्फ़िगरेशन
लॉगर को आपके
google_ads_config.rb
कॉन्फ़िगरेशन के हिस्से के तौर पर कॉन्फ़िगर किया जा सकता है. log_level
और
log_target
फ़ील्ड तय करके, डिफ़ॉल्ट लॉगर सेट अप किया जा सकता है या
logger
बताकर, खुद ही लॉगर तय किया जा सकता है. logger
तय करने पर log_level
और log_target
को
अनदेखा किया जाएगा.
client.logger=
का इस्तेमाल करके, क्लाइंट को इंस्टैंशिएट करने के बाद भी, लॉगर तय किया जा सकता है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-21 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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=`."]]