You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading Stack Driver Logging - java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment #2379
Hi,
I am trying to read logs from Stack Driver Logging. I have logged into gccloud.
Below is my program to read:
`public class App
{
Logging logging = LoggingOptions.getDefaultInstance().getService();
Hello World! Exception in thread "main" java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder. at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) at com.google.cloud.ServiceOptions.<init>(ServiceOptions.java:240) at com.google.cloud.logging.LoggingOptions.<init>(LoggingOptions.java:102) at com.google.cloud.logging.LoggingOptions$Builder.build(LoggingOptions.java:96) at com.google.cloud.logging.LoggingOptions.getDefaultInstance(LoggingOptions.java:55)
Though Project Id is passed, still i am getting the above exception. Please suggest. Thanks
Hi,
I am trying to read logs from Stack Driver Logging. I have logged into gccloud.
Below is my program to read:
`public class App
{
Logging logging = LoggingOptions.getDefaultInstance().getService();
}`
Getting below exception:
Hello World! Exception in thread "main" java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder. at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) at com.google.cloud.ServiceOptions.<init>(ServiceOptions.java:240) at com.google.cloud.logging.LoggingOptions.<init>(LoggingOptions.java:102) at com.google.cloud.logging.LoggingOptions$Builder.build(LoggingOptions.java:96) at com.google.cloud.logging.LoggingOptions.getDefaultInstance(LoggingOptions.java:55)Though Project Id is passed, still i am getting the above exception. Please suggest. Thanks