This application uses the Google Cloud Logging Client Libraries and can be compiled with Native Image Native Image.
-
Follow the GCP Project Authentication and Native Image Setup Instructions.
-
Enable the Logging APIs.
Navigate to this directory in a new terminal.
-
Compile the application using the Native Image Compiler. This step may take a few minutes.
mvn package -P native
-
Run the application:
./target/logging-sample
-
The application will log a message to your local terminal and to Google Cloud Console.
Navigate to the Cloud Console Logs Viewer to view you logs and find the newly generated log entry in Cloud Console:
This is a log produced by Native Image.