@@ -4,24 +4,26 @@ This sample demonstrates how to use [Stackdriver](https://cloud.google.com/error
441 . Create a compute instance on the Google Cloud Platform Developer's Console
551 . SSH into the instance you created
661 . Update packages and install required packages
7- sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven
7+ ` sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven `
881 . Follow the instructions to [ Install the Stackdriver Logging Agent] ( https://cloud.google.com/logging/docs/agent/installation )
991 . Create /etc/google-fluentd/config.d/forward.conf and add
10+ ``` xml
1011 <source >
1112 type forward
1213 port 24224
1314 </source >
15+ ```
14161. Restart the logging agent
15- sudo service google-fluentd restart
17+ ` sudo service google-fluentd restart`
16181. Clone the repo
17- git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
19+ ` git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git`
18201. Navigate to the Stackdriver sample folder
19- java-docs-samples/compute/stackdriver
21+ ` java-docs-samples/compute/stackdriver`
20221. Make sure that openjdk 8 is the selected java version
21- sudo update-alternatives --config java
23+ ` sudo update-alternatives --config java`
22241. Use maven to package the class as a jar
23- mvn clean package
25+ ` mvn clean package`
24261. Switch to the target folder and execute the jar file
25- java -jar compute-stackdriver-1.0-SNAPSHOT-jar-with-dependencies.jar
27+ ` java -jar compute-stackdriver-1.0-SNAPSHOT-jar-with-dependencies.jar`
26281. On the Developer's Console, navigate to Stackdriver Error Reporting and verify that the sample
2729 error was logged.
0 commit comments