Skip to content

Commit 4ffe9c1

Browse files
author
Nicolai Parlog
committed
Demonstrate unified logging
1 parent 6e26f0d commit 4ffe9c1

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Most are show-cased in these posts, though:
131131
* ⑱ external snippets in Javadoc: [referencing class](src/main/java/org/codefx/demo/java18/jvm/javadoc/SnippetDocs.java), [referenced demo class](src/demo/java/SnippetDocsDemo.java), and [configuration](pom.xml) ([feature introduction](https://nipafx.dev/inside-java-newscast-20/), [Maven how-to](https://nipafx.dev/javadoc-snippets-maven/), [JEP 413](http://openjdk.java.net/jeps/413))
132132
* ⑬⑫⑩ [application class-dara sharing](app-cds.sh) ([article](http://blog.codefx.org/java/application-class-data-sharing/), [JEP 310](http://openjdk.java.net/jeps/310), [JEP 341](http://openjdk.java.net/jeps/341), [JEP 350](http://openjdk.java.net/jeps/350))
133133
*[single-source-file execution](src/main/java/org/codefx/demo/java11/jvm/script) and scripting: run [the script](echo) with `cat echo-haiku.txt | ./echo` ([article](http://blog.codefx.org/java/scripting-java-shebang/), [JEP 330](https://openjdk.java.net/jeps/330))
134+
*[unified logging](unified-logging.sh) ([article](https://nipafx.dev/java-unified-logging-xlog/), [JEP 158](http://openjdk.java.net/jeps/158))
134135
* ⑨ multi-release JARs: [classes](src/main/java/org/codefx/demo/java9/internal/multi_release) and [the script](multi-release.sh) ([JEP 238](http://openjdk.java.net/jeps/238))
135136
* ⑨ platform logging: [classes](src/platform_logging/java/org/codefx/demo/java9/api/platform_logging) and [the script](platform-logging.sh) ([JEP 264](http://openjdk.java.net/jeps/264))
136137

unified-logging.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
echo "########################"
4+
echo "# BASIC LOGGING OUTPUT #"
5+
echo "########################"
6+
echo ""
7+
java -Xlog -version
8+
9+
echo ""
10+
echo "################"
11+
echo "# LOG WARNINGS #"
12+
echo "################"
13+
echo ""
14+
java -Xlog:all=warning -version
15+
16+
echo ""
17+
echo "###############"
18+
echo "# LOG GC INFO #"
19+
echo "###############"
20+
echo ""
21+
java -Xlog:gc*=info -version
22+
23+
echo ""
24+
echo "####################"
25+
echo "# LOG SOME GC INFO #"
26+
echo "####################"
27+
echo ""
28+
java -Xlog:gc*=info:stdout:time,uptimemillis -version
29+
30+
echo ""
31+
echo "###############"
32+
echo "# ALL OPTIONS #"
33+
echo "###############"
34+
echo ""
35+
java -Xlog:help

0 commit comments

Comments
 (0)