সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
লগিং জাভার জন্য একটি সাধারণ লগিং লাইব্রেরি SLF4J এর সাথে কনফিগার করা হয়েছে, যা লগগুলিকে বিভিন্ন লগিং বাস্তবায়নে নির্দেশিত করার অনুমতি দেয়। আমরা log4j 1.2/2 এবং Java Util Logging (JUL)-এর জন্য কনফিগারেশন ফাইল সরবরাহ করি।
লগিং বিন্যাস এবং কার্যকারিতা
অনুরোধগুলি একটি এক লাইন সারাংশ এবং সম্পূর্ণ অনুরোধ/প্রতিক্রিয়া প্রধান অংশ এবং শিরোনাম দিয়ে লগ করা হয়।
লগ টাইপ
লগ নাম
সাফল্যের স্তর
ব্যর্থতার স্তর
সারাংশ
com.google.ads.googleads.lib.request.summary
তথ্য
সতর্ক করুন
বিস্তারিত
com.google.ads.googleads.lib.request.detail
ডিবাগ
তথ্য
বিস্তারিত লগ ছেদন
বিশদ লগগুলি ডিফল্টভাবে ছোট করা হয় যাতে বড় লগ তৈরি না হয়। লগগুলি যে দৈর্ঘ্যে কাটা হয় তা পরিবর্তন করতে, সেট করুন -Dapi.googleads.maxLogMessageLength=<number> । সেটিং -1 লগ ছাঁটাই অক্ষম করে।
Log4j 2
log4j-slf4j-impl লাইব্রেরির উপর নির্ভরতা যোগ করুন, Log4j 2 এর সংস্করণের সাথে 2.xy প্রতিস্থাপন করুন যা আপনি আপনার প্রকল্পে ব্যবহার করছেন।
(ঐচ্ছিক) আপনার সংস্থান ডিরেক্টরিতে একটি কনফিগারেশন ফাইল তৈরি করুন, উদাহরণস্বরূপ, Maven এ: src/main/resources । Log4j 2 তার কনফিগারেশন ফাইলটি ক্লাসপথ থেকে লোড করে, ওয়ার্কিং ডিরেক্টরি নয়, তাই নিশ্চিত করুন যে আপনি একটি সংস্থান ডিরেক্টরিতে তৈরি করেছেন।
-Dlog4j.configurationFile=<CONFIG_FILE_PATH> উল্লেখ করে আপনার অ্যাপ্লিকেশনটি চালান। ক্লায়েন্ট লাইব্রেরির সাথে অন্তর্ভুক্ত ডিফল্ট কনফিগারেশন ফাইল ব্যবহার করতে আপনি CONFIG_FILE_PATH=googleads-logging/log4j2.xml নির্দিষ্ট করতে পারেন।
Log4j 1.2 (উত্তরাধিকার)
slf4j-log4j12 লাইব্রেরির উপর নির্ভরতা যোগ করুন, Log4j 1.2 এর সংস্করণের সাথে 1.xy প্রতিস্থাপন করুন যা আপনি আপনার প্রকল্পে ব্যবহার করছেন।
(ঐচ্ছিক) আপনার প্রজেক্ট রিসোর্স ডিরেক্টরিতে একটি কনফিগারেশন ফাইল তৈরি করুন, উদাহরণস্বরূপ, মাভেনে, পাথ হল src/main/resources । Log4j 1.2 এর কনফিগারেশন ফাইলটি ক্লাসপথ থেকে লোড করে, ওয়ার্কিং ডিরেক্টরি নয়, তাই নিশ্চিত করুন যে আপনি একটি রিসোর্স ডিরেক্টরিতে অনুলিপি করেছেন।
-Dlog4j.configuration=<CONFIG_FILE_PATH> উল্লেখ করে আপনার অ্যাপ্লিকেশনটি চালান। ক্লায়েন্ট লাইব্রেরির সাথে অন্তর্ভুক্ত ডিফল্ট কনফিগারেশন ফাইল ব্যবহার করতে আপনি CONFIG_FILE_PATH=googleads-logging/log4j.properties নির্দিষ্ট করতে পারেন।
আপনার অ্যাপ্লিকেশন থেকে পাঠযোগ্য একটি পাথে ফাইল সিস্টেমে একটি JUL কনফিগারেশন ফাইল তৈরি করুন (উদাহরণস্বরূপ, ./jdk-logger.properties )। google-ads/src/main/resources/googleads-logging/jdk-logger.properties এ একটি টেমপ্লেট দেওয়া হয়েছে। JUL শুধুমাত্র ফাইল সিস্টেম থেকে পড়ে, তাই রিসোর্স ডিরেক্টরিতে অনুলিপি করবেন না।
-Djava.util.logging.config.file=./jdk-logger.properties নির্দিষ্ট করে আপনার অ্যাপ্লিকেশন চালান।
[null,null,["2025-08-26 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eLogging is managed through SLF4J, offering flexibility with log4j 1.2/2 and Java Util Logging configurations.\u003c/p\u003e\n"],["\u003cp\u003eRequest logging includes a summary line along with detailed request/response bodies and headers at configurable log levels.\u003c/p\u003e\n"],["\u003cp\u003eDetailed logs are truncated by default, adjustable via the \u003ccode\u003e-Dapi.googleads.maxLogMessageLength\u003c/code\u003e system property.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration instructions and examples are provided for setup with Log4j 2, Log4j 1.2, and Java Util Logging.\u003c/p\u003e\n"]]],[],null,["# Logging is configured with SLF4J a generic logging library for Java, which\nallows logs to be directed to many different logging implementations. We provide\nconfiguration files for log4j 1.2/2 and Java Util Logging (JUL).\n\nLogging layout and functionality\n--------------------------------\n\nRequests are logged with a one line summary and the full request/response body\nand headers.\n\n| Log type | Log name | Success level | Failure level |\n|----------|----------------------------------------------|---------------|---------------|\n| SUMMARY | com.google.ads.googleads.lib.request.summary | INFO | WARN |\n| DETAIL | com.google.ads.googleads.lib.request.detail | DEBUG | INFO |\n\n| **Key Point:** Mutate requests where [Partial\n| failure](/google-ads/api/samples/handle-partial-failure) is true won't cause the entire request to fail. Thus, partial failure logs are always logged at Success level, not at Failure level as might be expected.\n\nDetail Log Truncation\n---------------------\n\nThe detailed logs are truncated by default to avoid creating large logs. To\nchange the length at which logs are truncated, set\n`-Dapi.googleads.maxLogMessageLength=\u003cnumber\u003e`. Setting `-1` disables\nlog truncation.\n\nLog4j 2\n-------\n\n1. Add a dependency on the `log4j-slf4j-impl` library, substituting\n `2.x.y` with the version of Log4j 2 you are using in your project.\n\n \u003cdependency\u003e\n \u003cgroupId\u003eorg.apache.logging.log4j\u003c/groupId\u003e\n \u003cartifactId\u003elog4j-slf4j-impl\u003c/artifactId\u003e\n \u003cversion\u003e2.x.y\u003c/version\u003e\n \u003c/dependency\u003e\n\n2. (Optional) Create a configuration file in your resources directory, for\n example, in Maven: `src/main/resources`. Log4j 2 loads its configuration\n file from the classpath, not the working directory, so ensure you create in a\n resources directory.\n\n3. Run your application, specifying\n `-Dlog4j.configurationFile=\u003cCONFIG_FILE_PATH\u003e`. You can specify\n `CONFIG_FILE_PATH=googleads-logging/log4j2.xml` to use the default\n configuration file included with the client libraries.\n\nLog4j 1.2 (legacy)\n------------------\n\n1. Add a dependency on the `slf4j-log4j12` library, substituting `1.x.y` with\n the version of Log4j 1.2 you are using in your project.\n\n \u003cdependency\u003e\n \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n \u003cartifactId\u003eslf4j-log4j12\u003c/artifactId\u003e\n \u003cversion\u003e1.x.y\u003c/version\u003e\n \u003c/dependency\u003e\n\n2. (Optional) Create a configuration file in your projects resources directory,\n for example, in Maven, path is `src/main/resources`. Log4j 1.2 loads its\n configuration file from the classpath, not the working directory, so ensure\n you copy to a resources directory.\n\n3. Run your application, specifying `-Dlog4j.configuration=\u003cCONFIG_FILE_PATH\u003e`.\n You can specify `CONFIG_FILE_PATH=googleads-logging/log4j.properties` to use\n the default configuration file includedwith the client libraries.\n\nJava Util Logging\n-----------------\n\n1. Add a dependency on the `slf4j-jdk14` library.\n\n \u003cdependency\u003e\n \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n \u003cartifactId\u003eslf4j-jdk14\u003c/artifactId\u003e\n \u003cversion\u003e1.7.25\u003c/version\u003e\n \u003c/dependency\u003e\n\n2. Create a JUL configuration file on the file system in a path readable from\n your application (for instance, `./jdk-logger.properties`). A template is\n provided at\n `google-ads/src/main/resources/googleads-logging/jdk-logger.properties`. JUL\n reads from the filesystem only, so do not copy to the resources directory.\n\n3. Run your application specifying\n `-Djava.util.logging.config.file=./jdk-logger.properties`."]]