5.0.5 • Published 7 months ago

@architect/logs v5.0.5

Weekly downloads
405
License
Apache-2.0
Repository
github
Last release
7 months ago

@architect/logs GitHub CI status

@architect/logs is a module that retrieves and clears logs associated to your @architect functions across environments.

Installation

npm i @architect/logs
let logs = require('@architect/logs')

API

logs({pathToCode, verbose, destroy, production}, callback)

Takes a parameter object as first argument which accepts the following properties:

  • pathToCode: required the local path to architect Function code relative to the current working directory, i.e. src/http/get-index
  • verbose: verbose super chatty mode
  • destroy: if truthy will delete logs via logs.destroy, otherwise will read logs via logs.read
  • production: if truthy will target your arc project's production environment, otherwise will default to staging

By default will read logs from the staging environment. If the destroy property is truthy, logs instead will be destroyed.

logs.read({name, pathToCode, ts}, callback)

Will read logs from aws.CloudWatchLogs, invoking getLogEvents for log retrieval.

Takes a parameter object as first argument which accepts the following properties:

  • name: the CloudFormation StackName passed to listStackResources within which to search Function logs. Note that this is inferred from your application name, environment and specific function you are querying - tread carefully!
  • pathToCode: required the local path to architect Function code relative to the current working directory, i.e. src/http/get-index
  • ts: timestamp to use as a start time for displaying length of time details (i.e. Date.now())

callback will be invoked with an error if an error arises during execution. Otherwise, callback will be invoked without arguments.

logs.destroy({name, pathToCode, ts}, callback)

Will delete logs from aws.CloudWatchLogs, invoking deleteLogGroup.

Takes a parameter object as first argument which accepts the following properties:

  • name: the CloudFormation StackName passed to listStackResources within which to search Function logs. Note that this is inferred from your application name, environment and specific function you are querying - tread carefully!
  • pathToCode: required the local path to architect Function code relative to the current working directory, i.e. src/http/get-index
  • ts: timestamp to use as a start time for displaying length of time details (i.e. Date.now())

callback will be invoked with an error if an error arises during execution. Otherwise, callback will be invoked without arguments.

5.0.5

7 months ago

5.0.4

7 months ago

5.0.3

8 months ago

5.0.2

10 months ago

5.0.1

10 months ago

5.0.0-RC.4

10 months ago

5.0.0

10 months ago

5.0.0-RC.3

10 months ago

5.0.0-RC.2

10 months ago

5.0.0-RC.1

11 months ago

5.0.0-RC.0

11 months ago

4.1.0

1 year ago

4.0.10

1 year ago

4.0.10-RC.0

1 year ago

4.0.7

2 years ago

4.0.9

2 years ago

4.0.8

2 years ago

4.0.6-RC.0

2 years ago

4.0.6

2 years ago

4.0.5-RC.0

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.3-RC.0

2 years ago

4.0.3

2 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0-RC.0

3 years ago

4.0.0-RC.1

3 years ago

4.0.0-RC.2

3 years ago

4.0.0

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.2

3 years ago

2.1.3

3 years ago

2.1.1-RC.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.1.0-RC.1

4 years ago

2.1.0-RC.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-RC.1

4 years ago

2.0.0-RC.0

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.8-RC.0

5 years ago

1.0.7

5 years ago

1.0.7-RC.1

5 years ago

1.0.7-RC.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.5-RC.3

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago