@bsb/observable-pino 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -16
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# @bsb/observable-pino
|
|
2
2
|
|
|
3
|
-
Pino observable plugin for BSB
|
|
3
|
+
Pino observable plugin for BSB providing high-performance JSON logging with minimal overhead.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
- High performance with async logging
|
|
8
|
+
- Structured JSON output by default
|
|
9
|
+
- Pretty printing for development
|
|
10
|
+
- Custom transports with Pino's ecosystem
|
|
11
|
+
- Built-in serializers for errors and objects
|
|
12
|
+
- Automatic sensitive data redaction
|
|
4
13
|
|
|
5
14
|
## Installation
|
|
6
15
|
|
|
@@ -8,17 +17,10 @@ Pino observable plugin for BSB - high-performance JSON logging with minimal over
|
|
|
8
17
|
npm install @bsb/observable-pino
|
|
9
18
|
```
|
|
10
19
|
|
|
11
|
-
## Features
|
|
12
|
-
|
|
13
|
-
- **High performance** - Async logging with minimal overhead
|
|
14
|
-
- **JSON output** - Structured logging by default
|
|
15
|
-
- **Pretty printing** - Human-readable development output
|
|
16
|
-
- **Custom transports** - Pino transport ecosystem support
|
|
17
|
-
- **Serializers** - Built-in error and object serialization
|
|
18
|
-
- **Redaction** - Automatic sensitive data redaction
|
|
19
|
-
|
|
20
20
|
## Configuration
|
|
21
21
|
|
|
22
|
+
Add the plugin to your BSB configuration file:
|
|
23
|
+
|
|
22
24
|
```yaml
|
|
23
25
|
plugins:
|
|
24
26
|
observables:
|
|
@@ -48,12 +50,47 @@ plugins:
|
|
|
48
50
|
|
|
49
51
|
### Configuration Options
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
| Option | Description | Default |
|
|
54
|
+
|--------|-------------|---------|
|
|
55
|
+
| `level` | Minimum log level | `info` |
|
|
56
|
+
| `prettyPrint.enabled` | Enable development-friendly formatting | `false` |
|
|
57
|
+
| `prettyPrint.colorize` | Colorize pretty output | `true` |
|
|
58
|
+
| `prettyPrint.translateTime` | Human-readable timestamps | `SYS:standard` |
|
|
59
|
+
| `transport` | Custom Pino transport configuration | Disabled |
|
|
60
|
+
| `serializers.error` | Enable error/object serialization | `true` |
|
|
61
|
+
| `base` | Default fields included in all logs | `{}` |
|
|
62
|
+
| `redact` | Array of field paths to redact | `[]` |
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
Once configured, logs are handled by Pino automatically:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
this.log.info("Service initialized");
|
|
70
|
+
this.log.error("Error occurred", new Error("Something went wrong"));
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## JSON Output Example
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"level": 30,
|
|
78
|
+
"time": 1706984400000,
|
|
79
|
+
"app": "my-service",
|
|
80
|
+
"msg": "Service initialized",
|
|
81
|
+
"traceId": "abc123",
|
|
82
|
+
"spanId": "def456"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
Detailed documentation (used by the BSB Registry): `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/observable-pino/docs/plugin.md`
|
|
89
|
+
|
|
90
|
+
## Links
|
|
91
|
+
|
|
92
|
+
- GitHub: `https://github.com/BetterCorp/better-service-base/tree/master/plugins/nodejs/observable-pino`
|
|
93
|
+
- BSB Registry (package): `https://io.bsbcode.dev/packages/nodejs/@bsb/observable-pino`
|
|
57
94
|
|
|
58
95
|
## License
|
|
59
96
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsb/observable-pino",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"license": "(AGPL-3.0-only OR Commercial)",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "BetterCorp (PTY) Ltd",
|
|
7
|
-
"email": "
|
|
7
|
+
"email": "ninja@bettercorp.dev",
|
|
8
8
|
"url": "https://bettercorp.dev/"
|
|
9
9
|
},
|
|
10
10
|
"description": "Pino observable plugin for BSB - high-performance JSON logger integration",
|
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
"node": ">=23.0.0",
|
|
55
55
|
"npm": ">=11.0.0"
|
|
56
56
|
},
|
|
57
|
-
"homepage": "https://io.bsbcode.dev/
|
|
57
|
+
"homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/observable-pino"
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|