로깅
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Google Ads API에 대한 요청, 응답, 요약 메시지는 자체 맞춤 로거 또는 Ruby 라이브러리의 기본 로거에 로깅될 수 있습니다.
로그 수준
라이브러리는 다양한 유형의 이벤트를 여러 로그 수준으로 로깅합니다. API 응답이 성공하면 요약이 INFO
에 로깅되고 전체 요청과 응답은 DEBUG
에 로깅됩니다. 요청에 API 오류가 발생하면 요약 메시지가 WARN
에 로깅되고 전체 요청 및 응답이 INFO
에 로깅됩니다.
부분 실패의 경우 부분 실패 세부정보가 DEBUG
에 기록됩니다.
구성
로거는 google_ads_config.rb 구성의 일부로 구성할 수 있습니다. log_level
및 log_target
필드를 지정하여 기본 로거를 설정하거나 logger
를 지정하여 자체 로거를 완전히 지정할 수 있습니다. logger
를 지정하면 log_level
및 log_target
가 무시됩니다.
client.logger=
를 사용하여 클라이언트를 인스턴스화한 후 로거를 지정할 수도 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 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=`."]]