MCPcopy
hub / github.com/serverless/serverless / getLogStreams

Method getLogStreams

packages/serverless/lib/plugins/aws/logs.js:73–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 async getLogStreams() {
74 const params = {
75 logGroupName: this.options.logGroupName,
76 descending: true,
77 limit: 50,
78 orderBy: 'LastEventTime',
79 }
80
81 const reply = await this.provider.request(
82 'CloudWatchLogs',
83 'describeLogStreams',
84 params,
85 )
86 if (!reply || reply.logStreams.length === 0) {
87 throw new ServerlessError(
88 'No existing streams for the function',
89 'NO_EXISTING_LOG_STREAMS',
90 { stack: false },
91 )
92 }
93
94 return reply.logStreams.map((logStream) => logStream.logStreamName)
95 }
96
97 /**
98 * Show logs

Callers 3

constructorMethod · 0.95
showLogsMethod · 0.95
logs-agent.test.jsFile · 0.45

Calls 1

requestMethod · 0.80

Tested by

no test coverage detected