# Class RemoteLoggingHelper (3.34.0)

3.34.0 (latest) 3.32.0 3.29.0 3.28.0 3.26.0 3.24.0 3.23.10 3.22.6 3.21.4 3.20.7 3.19.0 3.18.0 3.17.2 3.16.2 3.15.17 3.14.9 3.13.7 3.12.1 3.11.10 3.10.7 3.9.0 3.8.0 3.7.6 3.6.4 3.5.3

    public class RemoteLoggingHelper

Utility to create a remote logging configuration for testing. Logging options can be obtained via
the [#getOptions()](https://docs.cloud.google.com/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.testing.RemoteLoggingHelper#com_google_cloud_logging_testing_RemoteLoggingHelper_getOptions__) method. Returned options have custom LoggingOptions#getRetrySettings(): RetrySettings#getMaxRetryDelay() is `30000`,
RetrySettings#getTotalTimeout() is `120000` and RetrySettings#getInitialRetryDelay() is `250`.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> RemoteLoggingHelper

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### TEST_SINK_PREFIX

    public static final String TEST_SINK_PREFIX

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

## Static Methods

### create()

    public static RemoteLoggingHelper create()

Creates a `RemoteLoggingHelper` object using default project id and authentication
credentials.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.testing.RemoteLoggingHelper` |   |

### create(String projectId, InputStream keyStream)

    public static RemoteLoggingHelper create(String projectId, InputStream keyStream)

Creates a `RemoteLoggingHelper` object for the given project id and JSON key input
stream.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` id of the project to be used for running the tests |
| `keyStream` | `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` input stream for a JSON key |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.testing.RemoteLoggingHelper` | A `RemoteLoggingHelper` object for the provided options |

### formatForTest(String name)

    public static String formatForTest(String name)

Formats a resource name for testing purpose. This method appends a random UUID to the provided
name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

## Methods

### getOptions()

    public LoggingOptions getOptions()

Returns a [LoggingOptions](https://docs.cloud.google.com/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.LoggingOptions) object to be used for testing.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-logging/latest/com.google.cloud.logging.LoggingOptions` |   |