# @amplication/plugin-logger-json

> Amplication plugin to display your logs in JSON

Latest version **1.0.6** (published 2024-02-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @amplication/plugin-logger-json
pnpm add @amplication/plugin-logger-json
yarn add @amplication/plugin-logger-json
bun add @amplication/plugin-logger-json
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2024-02-26 |
| First published | 2023-11-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sakurablossoms01 |
| Maintainers | amplication-bot, mulygottlieb, levivannoort, overbit, barshimi, morhag, amitbarletz, yuvalhazaz |

## Links

- npm: https://www.npmjs.com/package/@amplication/plugin-logger-json
- npm.io page: https://npm.io/package/@amplication/plugin-logger-json

## Dependencies (11)

- [tslib](https://npm.io/package/tslib.md) ^2.6.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [recast](https://npm.io/package/recast.md) ^0.23.4
- [ast-types](https://npm.io/package/ast-types.md) ^0.14.2
- [asty-astq](https://npm.io/package/asty-astq.md) ^1.13.7
- [json-asty](https://npm.io/package/json-asty.md) ^1.2.0
- [@types/node](https://npm.io/package/@types/node.md) ^20.9.5
- [json-to-ast](https://npm.io/package/json-to-ast.md) ^2.1.0
- [@types/json-to-ast](https://npm.io/package/@types/json-to-ast.md) ^2.1.4
- [@amplication/code-gen-types](https://npm.io/package/@amplication/code-gen-types.md) ^2.0.20
- [@amplication/code-gen-utils](https://npm.io/package/@amplication/code-gen-utils.md) ^0.0.7

## Recent versions

- 1.0.6 (latest) — 2024-02-26
- 1.0.9-beta.pr-354.1e83d71 (beta) — 2024-03-12
- 1.0.9-beta.pr-354.31d30ce — 2024-03-12
- 1.0.8 — 2024-03-08
- 1.0.7 — 2024-03-08
- 1.0.5 — 2023-12-28
- 1.0.3 — 2023-12-21
- 1.0.2 — 2023-12-21
- 1.0.1 — 2023-11-28
- 1.0.1-beta.pr-297.80f0b66 — 2023-11-28
- 1.0.0 — 2023-11-28

## README

# plugin-logger-json

[![NPM Downloads](https://img.shields.io/npm/dt/plugin-logger-json)](https://www.npmjs.com/package/plugin-logger-json)

## Purpose

This plugins allows to log in a JSON format rather than less common string NestJS format.

## Configuration

You can configure the logger plugin in the following ways:

- `logLevel`: The level of messages to log. Possible values are 'fatal' , 'error' , 'warn' , 'info' , 'debug' , 'trace' or 'silent'.
- `additionalLogProperties`: A dictionary of the extra properties that you want to add with each log messages.
- `logRequest`: A boolean value to enable or disable logging of request and response. Default is `false`.
- `sensitiveKeys`: An array of keys that you want to redact from the request and response logs. Default is `[]`.
- `pinoPretty`: A boolean value to enable or disable pretty printing of the logs. Default is `false`.

Examples:

```json
{
  "logLevel": "info",
  "additionalLogProperties": {
    "someKey": "someValue",
    "project": "A",
    "team": "di"
  }
}
```

```json
{
  "logRequest": true,
  "sensitiveKeys": ["req.headers.authorization"],
}
```



## Usage

1. Enable the plugin in your Amplication app.

By enabling this plugin, a new folder named `logger` is added to your `server/src/` directory which contains all the files for the logger configuration.

## Scripts

### `build`

Running `npm run build` will bundle your plugin with Webpack for production.

### `dev`

Running `npm run dev` will watch your plugin's source code and automatically bundle it with every change.

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