জাভা ৯ JVM কম্পোনেন্টের জন্য একটি কমন লগিং সিস্টেম প্রদান করে ডিটেইলড লেভেলে। নতুন কমান্ড-লাইন অপশন: -Xlog ব্যবহার করে সব লগিং সেটিংস এবং ইউনিফাইড JVM লগিং আমাদের একটি ইজি-টু-কনফিগার টুল দেয় রুট কজ অ্যানালিসিস (RCA) করার জন্য জটিল সিস্টেম-লেভেল JVM কম্পোনেন্টের।
কমান্ড লাইন -Xlog সব লগিং JVM কম্পোনেন্ট কন্ট্রোল করতে ব্যবহৃত হয়। -Xlog-এর আর্গুমেন্ট নিচের রুল ফলো করে:
- মাল্টিপল আর্গুমেন্ট কমান্ড-লাইনে যেসব ক্রমে থাকে সেসব ক্রমে অ্যাপ্লাই হয়।
- লাস্ট কনফিগারেশন রুল: একই আউটপুটের জন্য মাল্টিপল আর্গুমেন্ট দিয়ে দিয়ে একে অপরের ওপর ওভাররাইড করে দিয়ে যাওয়া ক্রমে।
Xlog: disable সকল লগিং অফ করে এবং লগিং ফ্রেমওয়ার্কের সব কনফিগারেশন ক্লিয়ার করে (রয়েছে ওয়ার্নিংস এবং এরর সহ)।
সিনট্যাক্স
-Xlog:tag[*][=level][:output:decoration:output-option],tag...
-Xlog: help প্রিন্ট করে -Xlog ইউজেজ সিনট্যাক্স এবং উপলব্ধ ট্যাগ, লেভেল, ডেকোরেটর কিছু উদাহরণ কমান্ড লাইনের সাথে।
১) Tags:
যখন একটি লগ মেসেজ শো হয়, এটি JVM-এ একটি সেট ট্যাগের সাথে asoshiate থাকে যা নাম দিয়ে আইডেন্টিফাই হয়: os, gc, modules। আমরা indywidual ট্যাগের জন্য আলাদা সেটিংস অ্যাপ্লাই করি এবং '*' একটি 'ওয়াইল্ডকার্ড' ট্যাগ ম্যাচ ডিনোট করে।
২) Levels:
আমরা বিভিন্ন লেভেলে লগিং পারফর্ম করি, এবং উপলব্ধ লেভেলগুলো: error, warning, info, debug, trace এবং develop। লগিং ডিজেবল করতে হলে alternative off ব্যবহার করুন।
৩) Outputs:
আউটপুট তিন টাইপ সাপোর্ট করে: stdout, stderr, এবং টেক্সট ফাইল (লগ ফাইল রোটেশন সেটআপ করার জন্য লেখা সাইজ এবং ফাইল সংখ্যা বেসড)।
৪) Decorators:
মেসেজ সম্পর্কে আরও ডিটেইল যাকে ডেকোরেটর বলা হয়। লিস্ট নিচে:
- time/timemillis/timenanos: করেন্ট টাইম এবং ডেট (ISO-8601 ফরম্যাট)
- uptime/uptimemillis/uptimenanos: JVM শুরু হয়ার পর থেকে টাইম
- pid: প্রসেস আইডেন্টিফায়ার
- tid: থ্রেড আইডেন্টিফায়ার
- level: লগ মেসেজের সাথে asoshiate লেভেল
- tags: লগ মেসেজের সাথে asoshiate ট্যাগ
java -Xlog:help আউটপুট (আংশিক)
C:\Program Files\Java\jdk-9.0.4\bin>java -Xlog:help -Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]] where 'what' is a combination of tags and levels of the form tag1[+tag2...][*][=level][,...] Unless wildcard (*) is specified, only log messages tagged with exactly the tags specified will be matched. Available log levels: off, trace, debug, info, warning, error Available log decorators: time (t), utctime (utc), uptime (u), timemillis (tm), uptimemillis (um), timenanos (tn), uptimenanos (un), hostname(hn), pid (p), tid (ti), level (l), tags (tg) Decorators can also be specified as 'none' for no decoration. Available log tags: add, age, alloc, aot, annotation, arguments, attach, barrier, biasedlocking, blocks, bot, breakpoint, census, class, classhisto, cleanup, compaction, constraints, constantpool, coops, cpu, cset, data, defaultmethods, dump, ergo, exceptions, exit, fingerprint, freelist, gc, hashtables, heap, humongous, ihop, iklass, init, itables, jni, jvmti, liveness, load, loader, logging, mark, marking, methodcomparator, metadata, metaspace, mmu, module, monitorinflation, monitormismatch, nmethod, normalize, objecttagging, obsolete, oopmap, os, pagesize, patch, path, phases, plab, promotion, preorder, protectiondomain, ref, redefine, refine, region, remset, purge, resolve, safepoint, scavenge, scrub, stacktrace, stackwalk, start, startuptime, state, stats, stringdedup, stringtable, stackmap, subclass, survivor, sweep, task, thread, tlab, time, timer, update, nload, verification, verify, vmoperation, vtables, workgang, jfr, system, parser, bytecode, setting, event Specifying 'all' instead of a tag combination matches all tag combinations. Described tag combinations: logging: Logging for the log framework itself Available log outputs: stdout, stderr, file= Specifying %p and/or %t in the filename will expand to the JVM's PID and startup timestamp, respectively. Some examples: -Xlog: Log all messages using 'info' level to stdout with 'uptime', 'levels' and 'tags' decorations. (Equivalent to -Xlog:all=info:stdout:uptime,levels,tags). -Xlog:gc: Log messages tagged with 'gc' tag using 'info' level to stdout, with default decorations. -Xlog:gc,safepoint: Log messages tagged either with 'gc' or 'safepoint' tags, both using 'info' level, to stdout, with default decorations. (Messaged tagged with both 'gc' and 'safepoint' will not be logged.)