@architect/logs is a module that retrieves and clears logs associated to your @architect functions across environments.
npm i @architect/logs
let logs = require('@architect/logs')
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 vialogs.destroy
, otherwise will read logs vialogs.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.
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 CloudFormationStackName
passed tolistStackResources
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.
Will delete logs from aws.CloudWatchLogs
, invoking
deleteLogGroup
.
Takes a parameter object as first argument which accepts the following properties:
-
name
: the CloudFormationStackName
passed tolistStackResources
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.