# @architect/logs

> Manage logging from Architect-provisioned cloud functions

Latest version **7.0.1** (published 2025-11-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @architect/logs
pnpm add @architect/logs
yarn add @architect/logs
bun add @architect/logs
```

Provides the command `arc-logs`.

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 7.0.1 |
| Published | 2025-11-29 |
| First published | 2019-07-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=22 |
| Dependencies | 6 |
| Unpacked size | 26.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | brianleroux, dam, kborchers, ryanblock, architectci, filmaj |
| Keywords | arc, logs |

## Links

- npm: https://www.npmjs.com/package/@architect/logs
- Repository: https://github.com/architect/logs
- Homepage: https://github.com/architect/logs#readme
- Issues: https://github.com/architect/logs/issues
- npm.io page: https://npm.io/package/@architect/logs

## Dependencies (6)

- [strftime](https://npm.io/package/strftime.md) 0.10.3
- [@architect/utils](https://npm.io/package/@architect/utils.md) ~6.0.1
- [@aws-lite/client](https://npm.io/package/@aws-lite/client.md) ^0.23.2
- [@architect/inventory](https://npm.io/package/@architect/inventory.md) ~6.0.0
- [@aws-lite/cloudformation](https://npm.io/package/@aws-lite/cloudformation.md) ^0.1.3
- [@aws-lite/cloudwatch-logs](https://npm.io/package/@aws-lite/cloudwatch-logs.md) ^0.1.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 7.0.1 (latest) — 2025-11-29
- 7.0.0-RC.0 (RC) — 2025-11-25
- 7.0.0 — 2025-11-27
- 6.0.1 — 2025-09-25
- 6.0.0 — 2025-09-24
- 5.0.6-RC.0 — 2025-09-24
- 5.0.5 — 2024-04-30
- 5.0.4 — 2024-04-29
- 5.0.3 — 2024-03-25
- 5.0.2 — 2024-02-08
- 5.0.1 — 2024-02-05
- 5.0.0 — 2024-02-02
- 5.0.0-RC.4 — 2024-02-01
- 5.0.0-RC.3 — 2024-01-31
- 5.0.0-RC.2 — 2024-01-24
- … 54 more at https://npm.io/package/@architect/logs/versions

## README

# `@architect/logs` [![GitHub CI status](https://github.com/architect/logs/workflows/Node%20CI/badge.svg)](https://github.com/architect/logs/actions?query=workflow%3A%22Node+CI%22)
<!-- [![codecov](https://codecov.io/gh/architect/logs/branch/master/graph/badge.svg)](https://codecov.io/gh/architect/logs) -->

[@architect/logs][npm] 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`][destroy], otherwise will
    read logs via [`logs.read`][read]
- `production`: if truthy will target your arc project's production environment,
    otherwise will default to staging

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

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

Will read logs from [`aws.CloudWatchLogs`][cloudwatchlogs], invoking
[`getLogEvents`][getlogevents] for log retrieval.

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

- `name`: the CloudFormation `StackName` passed to
    [`listStackResources`][liststack] 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`][cloudwatchlogs], invoking
[`deleteLogGroup`][deleteloggroup].

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

- `name`: the CloudFormation `StackName` passed to
    [`listStackResources`][liststack] 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.

[npm]: https://www.npmjs.com/package/@architect/logs
[read]: #logsreadname-pathtocode-ts-callback
[destroy]: #logsdestroyname-pathtocode-ts-callback
[liststack]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html#listStackResources-property
[cloudwatchlogs]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchLogs.html
[getlogevents]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchLogs.html#getLogEvents-property
[deleteloggroup]: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchLogs.html#deleteLogGroup-property

---
_Source: https://npm.io/package/@architect/logs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
