Members
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/logging_service_v2_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/config_service_v2_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/metrics_service_v2_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
v2
Reference to the low-level auto-generated clients for the V2 Logging service.
Properties:
Name | Type | Description |
---|---|---|
LoggingServiceV2Client |
constructor |
Reference to v2.LoggingServiceV2Client |
ConfigServiceV2Client |
constructor |
Reference to v2.ConfigServiceV2Client |
MetricsServiceV2Client |
constructor |
Reference to v2.MetricsServiceV2Client |
Methods
decodeValue(value) → {*}
Decode a protobuf Struct's value.
Parameters:
Name | Type | Description |
---|---|---|
value |
object |
A Struct's Field message. |
Returns:
Type | Description |
---|---|
* |
|
(async) detectServiceContext()
For logged errors, users can provide a service context. This enables errors to be picked up Stackdriver Error Reporting. For more information see this guide and the official documentation.
getCloudFunctionDescriptor() → {object}
Create a descriptor for Cloud Functions.
Returns:
Type | Description |
---|---|
object |
(async) getDefaultResource()
Attempt to contact the metadata service and determine, based on request success and environment variables, what type of resource the library is operating on.
(async) getGAEDescriptor() → {object}
Create a descriptor for Google App Engine.
Returns:
Type | Description |
---|---|
object |
(async) getGCEDescriptor() → {object}
Create a descriptor for Google Compute Engine.
Returns:
Type | Description |
---|---|
object |
(async) getGKEDescriptor() → {object}
Create a descriptor for Google Container Engine.
Returns:
Type | Description |
---|---|
object |
getGlobalDescriptor() → {object}
Create a global descriptor.
Returns:
Type | Description |
---|---|
object |
makeMiddleware(projectId, makeChildLogger, emitRequestLog)
Generates an express middleware that installs a request-specific logger on
the request
object. It optionally can do HttpRequest timing that can be
used for generating request logs. This can be used to integrate with logging
libraries such as winston and bunyan.
Parameters:
Name | Type | Description |
---|---|---|
projectId |
Generated traceIds will be associated with this project. |
|
makeChildLogger |
A function that generates logger instances that will
be installed onto |
|
emitRequestLog |
Optional. A function that will emit a parent request
log. While some environments like GAE and GCF emit parent request logs
automatically, other environments do not. When provided this function will be
called with a populated |
Type Definitions
ClientConfig
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
projectId |
string |
<optional> |
The project ID from the Google Developer's
Console, e.g. 'grape-spaceship-123'. We will also check the environment
variable |
|||||||||||||
keyFilename |
string |
<optional> |
Full path to the a .json, .pem, or .p12 key
downloaded from the Google Developers Console. If you provide a path to a
JSON file, the |
|||||||||||||
email |
string |
<optional> |
Account email address. Required when using a .pem or .p12 keyFilename. |
|||||||||||||
credentials |
object |
<optional> |
Credentials object. Properties
|
|||||||||||||
autoRetry |
boolean |
<optional> |
true |
Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. |
||||||||||||
maxRetries |
number |
<optional> |
3 |
Maximum number of automatic retries attempted before returning the error. |
||||||||||||
promise |
Constructor |
<optional> |
Custom promise module to use instead of native Promises. |
CreateSinkCallback(errnullable, sink, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
sink |
Sink |
The new Sink. |
|
apiResponse |
object |
The full API response. |
CreateSinkRequest
Config to set for the sink. Not all available options are listed here, see the Sink resource definition for full details.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. |
destination |
Bucket | Dataset | Topic |
<optional> |
The destination. The proper ACL scopes will be granted to the provided destination. Can be one of: Bucket, Dataset, or Topic |
filter |
string |
<optional> |
An advanced logs filter. Only log entries matching the filter are written. |
uniqueWriterIdentity |
string |
<optional> |
Determines the kind of IAM
identity returned as |
CreateSinkResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
Sink |
The new Sink. |
1 |
object |
The full API response. |
DeleteLogCallback(errnullable, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
apiResponse |
object |
The full API response. |
DeleteLogResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The full API response. |
DeleteSinkCallback(errnullable, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
apiResponse |
object |
The full API response. |
DeleteSinkResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The full API response. |
GetEntriesCallback(errnullable, entries, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
entries |
Array.<Entry> |
Array of Entry instances. |
|
apiResponse |
object |
The full API response. |
GetEntriesRequest
Query object for listing entries.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
autoPaginate |
boolean |
<optional> |
true |
Have pagination handled automatically. |
filter |
string |
<optional> |
An advanced logs filter. An empty filter matches all log entries. |
|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. |
|
log |
string |
<optional> |
A name of the log specifying to pnly return entries from this log. |
|
maxApiCalls |
number |
<optional> |
Maximum number of API calls to make. |
|
maxResults |
number |
<optional> |
Maximum number of items plus prefixes to return. |
|
orderBy |
string |
<optional> |
How the results should be sorted,
|
|
pageSize |
number |
<optional> |
Maximum number of logs to return. |
|
pageToken |
string |
<optional> |
A previously-returned page token representing part of the larger set of results to view. |
GetEntriesResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
Array.<Entry> |
Array of Entry instances. |
1 |
object |
The full API response. |
GetLogsCallback(errnullable, logs, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
logs |
Array.<Log> |
Array of Log instances. |
|
apiResponse |
object |
The full API response. |
GetLogsRequest
Query object for listing entries.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
autoPaginate |
boolean |
<optional> |
true |
Have pagination handled automatically. |
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. |
|
maxApiCalls |
number |
<optional> |
Maximum number of API calls to make. |
|
maxResults |
number |
<optional> |
Maximum number of items plus prefixes to return. |
|
pageSize |
number |
<optional> |
Maximum number of logs to return. |
|
pageToken |
string |
<optional> |
A previously-returned page token representing part of the larger set of results to view. |
GetLogsResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
Array.<Log> |
Array of Log instances. |
1 |
object |
The full API response. |
GetSinkMetadataCallback(errnullable, metadata, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
metadata |
object |
The Sink metadata. |
|
apiResponse |
object |
The full API response. |
GetSinkMetadataResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The Sink metadata. |
1 |
object |
The full API response. |
GetSinksCallback(errnullable, sinks, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
sinks |
Array.<Sink> |
Array of Sink instances. |
|
apiResponse |
object |
The full API response. |
GetSinksRequest
Query object for listing sinks.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
autoPaginate |
boolean |
<optional> |
true |
Have pagination handled automatically. |
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. |
|
maxApiCalls |
number |
<optional> |
Maximum number of API calls to make. |
|
maxResults |
number |
<optional> |
Maximum number of items plus prefixes to return. |
|
pageSize |
number |
<optional> |
Maximum number of logs to return. |
|
pageToken |
string |
<optional> |
A previously-returned page token representing part of the larger set of results to view. |
GetSinksResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
Array.<Sink> |
Array of Sink instances. |
1 |
object |
The full API response. |
LogWriteCallback(errnullable, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
apiResponse |
object |
The full API response. |
LogWriteResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The full API response. |
SetSinkFilterCallback(errnullable, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
apiResponse |
object |
The full API response. |
SetSinkFilterResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The full API response. |
SetSinkMetadataCallback(errnullable, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
apiResponse |
object |
The full API response. |
SetSinkMetadataResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
object |
The full API response. |
WriteOptions
Write options.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
dryRun |
boolean |
<optional> |
If true, the request should expect normal response, but the entries won't be persisted nor exported. |
gaxOptions |
object |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. |
|
labels |
Array.<object> |
Labels to set on the log. |
|
partialSuccess |
boolean |
<optional> |
Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. |
resource |
object |
A default monitored resource for entries where one isn't specified. |