@@ -4,24 +4,26 @@ This sample demonstrates how to use [Stackdriver](https://cloud.google.com/error
4
4
1 . Create a compute instance on the Google Cloud Platform Developer's Console
5
5
1 . SSH into the instance you created
6
6
1 . 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 `
8
8
1 . Follow the instructions to [ Install the Stackdriver Logging Agent] ( https://cloud.google.com/logging/docs/agent/installation )
9
9
1 . Create /etc/google-fluentd/config.d/forward.conf and add
10
+ ``` xml
10
11
<source >
11
12
type forward
12
13
port 24224
13
14
</source >
15
+ ```
14
16
1. Restart the logging agent
15
- sudo service google-fluentd restart
17
+ ` sudo service google-fluentd restart`
16
18
1. 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`
18
20
1. Navigate to the Stackdriver sample folder
19
- java-docs-samples/compute/stackdriver
21
+ ` java-docs-samples/compute/stackdriver`
20
22
1. Make sure that openjdk 8 is the selected java version
21
- sudo update-alternatives --config java
23
+ ` sudo update-alternatives --config java`
22
24
1. Use maven to package the class as a jar
23
- mvn clean package
25
+ ` mvn clean package`
24
26
1. 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`
26
28
1. On the Developer's Console, navigate to Stackdriver Error Reporting and verify that the sample
27
29
error was logged.
0 commit comments