Send feedback
Class Logging (9.3.1)
Stay organized with collections
Save and categorize content based on your preferences.
Version 9.3.1keyboard_arrow_down
Package
@google-cloud/logging!
Constructors
(constructor)(options)
constructor ( options ?: LoggingOptions );
Constructs a new instance of the Logging
class
Parameter
Properties
api
api : {
[ key : string ] : gax . ClientStub ;
};
Property Value
Type
Description
{
[key: string]: gax.ClientStub ;
}
auth
Property Value
Type
Description
gax.GoogleAuth
configService
configService ?: typeof v2 . ConfigServiceV2Client ;
Property Value
Type
Description
typeof v2 .ConfigServiceV2Client
detectedResource
detectedResource ?: object ;
Property Value
loggingService
loggingService ?: typeof v2 . LoggingServiceV2Client ;
Property Value
Type
Description
typeof v2 .LoggingServiceV2Client
options
Property Value
projectId
Property Value
Methods
createSink(name, config)
createSink ( name : string , config : CreateSinkRequest ) : Promise <[ Sink , LogSink ]>;
Parameters
Returns
Type
Description
Promise <[Sink , LogSink ]>
createSink(name, config, callback)
createSink ( name : string , config : CreateSinkRequest , callback : CreateSinkCallback ) : void ;
Parameters
Returns
entry(resource, data)
entry ( resource ?: LogEntry , data ?: {} | string ) : Entry ;
Parameters
Returns
Type
Description
Entry
{Entry}
getEntries(options)
getEntries ( options ?: GetEntriesRequest ) : Promise<GetEntriesResponse> ;
Parameter
Name
Description
options
GetEntriesRequest
Returns
Type
Description
Promise <GetEntriesResponse >
getEntries(callback)
getEntries ( callback : GetEntriesCallback ) : void ;
Parameter
Returns
getEntries(options, callback)
getEntries ( options : GetEntriesRequest , callback : GetEntriesCallback ) : void ;
Parameters
Returns
getEntriesStream(options)
getEntriesStream ( options ?: GetEntriesRequest ) : Duplex ;
List the Entry objects in your logs as a readable object stream.
Logging#getEntriesStream
Parameter
Name
Description
options
GetEntriesRequest
Returns
Type
Description
Duplex
{ReadableStream} A readable stream that emits Entry instances.
getLogs(options)
getLogs ( options ?: GetLogsRequest ) : Promise<GetLogsResponse> ;
Parameter
Returns
Type
Description
Promise <GetLogsResponse >
getLogs(callback)
getLogs ( callback : GetLogsCallback ) : void ;
Parameter
Returns
getLogs(options, callback)
getLogs ( options : GetLogsRequest , callback : GetLogsCallback ) : void ;
Parameters
Returns
getLogsStream(options)
getLogsStream ( options ?: GetLogsRequest ) : Duplex ;
List the Log objects in your project as a readable object stream.
Logging#getLogsStream
Parameter
Returns
Type
Description
Duplex
{ReadableStream} A readable stream that emits Log instances.
getSinks(options)
getSinks ( options ?: GetSinksRequest ) : Promise<GetSinksResponse> ;
Parameter
Returns
Type
Description
Promise <GetSinksResponse >
getSinks(callback)
getSinks ( callback : GetSinksCallback ) : void ;
Parameter
Returns
getSinks(options, callback)
getSinks ( options : GetSinksRequest , callback : GetSinksCallback ) : void ;
Parameters
Returns
getSinksStream(options)
getSinksStream ( options : GetSinksRequest ) : Duplex ;
Get the Sink objects associated with this project as a readable object stream.
Logging#getSinksStream
Parameter
Returns
Type
Description
Duplex
{ReadableStream} A readable stream that emits Sink instances.
log(name, options)
log ( name : string , options ?: LogOptions ) : Log ;
Parameters
Name
Description
name
string
Name of the existing log.
options
LogOptions
Configuration object.
Returns
Type
Description
Log
{Log}
request(config, callback)
request<TResponse = any >( config : RequestConfig , callback ?: RequestCallback<TResponse> ) : Duplex ;
Funnel all API requests through this method, to be sure we have a project ID.
Parameters
Returns
Type Parameter
Name
Description
TResponse
setAclForBucket_(config)
setAclForBucket_ ( config : CreateSinkRequest ) : Promise<void> ;
This method is called when creating a sink with a Bucket destination. The bucket must first grant proper ACL access to the Cloud Logging account.
The parameters are the same as what accepts.
Parameter
Returns
Type
Description
Promise <void>
setAclForDataset_(config)
setAclForDataset_ ( config : CreateSinkRequest ) : Promise<void> ;
This method is called when creating a sink with a Dataset destination. The dataset must first grant proper ACL access to the Cloud Logging account.
The parameters are the same as what accepts.
Parameter
Returns
Type
Description
Promise <void>
setAclForTopic_(config)
setAclForTopic_ ( config : CreateSinkRequest ) : Promise<void> ;
This method is called when creating a sink with a Topic destination. The topic must first grant proper ACL access to the Cloud Logging account.
The parameters are the same as what accepts.
Parameter
Returns
Type
Description
Promise <void>
setProjectId(reqOpts)
setProjectId ( reqOpts : {}) : Promise<void> ;
Parameter
Name
Description
reqOpts
{}
Returns
Type
Description
Promise <void>
sink(name)
sink ( name : string ) : Sink ;
Parameter
Name
Description
name
string
Name of the existing sink.
Returns
Type
Description
Sink
{Sink}
tailEntries(options)
tailEntries ( options ?: TailEntriesRequest ) : Duplex ;
Streaming read of live logs as log entries are ingested. Until the stream is terminated, it will continue reading logs.
Logging#tailEntries
Parameter
Name
Description
options
TailEntriesRequest
Returns
Type
Description
Duplex
{DuplexStream} A duplex stream that emits TailEntriesResponses containing an array of Entry instances.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[],[]]