syntropylog 0.6.7 → 0.6.8
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 +82 -77
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,39 +24,34 @@ Ship resilient, secure, and cost-effective Node.js applications with confidence.
|
|
|
24
24
|
|
|
25
25
|
> **⚠️ ALPHA VERSION WARNING** ⚠️
|
|
26
26
|
>
|
|
27
|
-
> **SyntropyLog is currently in ALPHA phase (0.6.
|
|
27
|
+
> **SyntropyLog is currently in ALPHA phase (0.6.8).**
|
|
28
28
|
>
|
|
29
|
-
> - **
|
|
30
|
-
> - **
|
|
31
|
-
> - **
|
|
32
|
-
> - **
|
|
29
|
+
> - **Core features stable**: Logger, context, HTTP, Redis, brokers (tested)
|
|
30
|
+
> - **Experimental features**: Doctor CLI (in development)
|
|
31
|
+
> - **API may change**: Advanced features still in development
|
|
32
|
+
> - **Use for learning**: Perfect for experimentation and early adoption
|
|
33
33
|
|
|
34
|
-
> ## 🚀 Project Status: Alpha Version 0.6.
|
|
34
|
+
> ## 🚀 Project Status: Alpha Version 0.6.8 🚀
|
|
35
35
|
>
|
|
36
|
-
> **SyntropyLog
|
|
36
|
+
> **SyntropyLog has a solid foundation with comprehensive test coverage and working examples.**
|
|
37
37
|
>
|
|
38
|
-
> The core API is
|
|
38
|
+
> The core API is stable with **94.04% test coverage** across **604+ tests**. Core features are tested and working, while advanced features continue development.
|
|
39
39
|
>
|
|
40
|
-
> ### 🎯 Latest Achievements (0.6.
|
|
41
|
-
> - **🚀 Build System
|
|
42
|
-
> -
|
|
43
|
-
> -
|
|
44
|
-
> - **✅ Examples Compatibility**: All examples now work with published npm versions
|
|
40
|
+
> ### 🎯 Latest Achievements (0.6.8)
|
|
41
|
+
> - **🚀 Build System**: Rollup configuration working with proper bundle generation (~145KB bundle size)
|
|
42
|
+
> - **📦 Bundle Optimization**: Single-file bundles with proper exports (CJS, ESM, TypeScript)
|
|
43
|
+
> - **✅ Examples Compatibility**: Core examples (00-03, 10-13, 20-22) work with published npm versions
|
|
45
44
|
> - **🛠️ Development Workflow**: Automated version update script for examples
|
|
46
|
-
> - **Redis Architecture
|
|
47
|
-
> - **Enhanced Error Handling**: Graceful handling of empty Redis configurations
|
|
48
|
-
> - **Robust Test Suite**:
|
|
49
|
-
> - **Framework Agnosticism Demo**: Examples 12 & 13 demonstrate Express vs Fastify
|
|
50
|
-
> - **Redis Integration**: Automatic caching with
|
|
51
|
-
> - **
|
|
52
|
-
> - **Code Quality**: Eliminated 408 lines of dead code across examples
|
|
53
|
-
> - **Enhanced Documentation**: Real logs, working commands, and comprehensive troubleshooting guides
|
|
54
|
-
> - **Framework Agnostic Design**: Removed deprecated `request` library, now supports any HTTP client via adapters
|
|
45
|
+
> - **Redis Architecture**: RedisManager with BeaconRedis for better separation of concerns
|
|
46
|
+
> - **Enhanced Error Handling**: Graceful handling of empty Redis configurations
|
|
47
|
+
> - **Robust Test Suite**: 94.04% test coverage across 604 tests
|
|
48
|
+
> - **Framework Agnosticism Demo**: Examples 12 & 13 demonstrate Express vs Fastify
|
|
49
|
+
> - **Redis Integration**: Automatic caching with intelligent TTL management
|
|
50
|
+
> - **Framework Agnostic Design**: Supports any HTTP client via adapters
|
|
55
51
|
> - **Custom Adapter System**: Full support for custom HTTP client adapters
|
|
56
52
|
> - **Improved Type Safety**: Better TypeScript support and type exports
|
|
57
|
-
> - **Robust Serialization Pipeline**: Intelligent serialization with precise complexity tracking
|
|
58
53
|
>
|
|
59
|
-
>
|
|
54
|
+
> Core features are ready for experimentation and early adoption. Advanced features and additional examples are in active development.
|
|
60
55
|
|
|
61
56
|
---
|
|
62
57
|
|
|
@@ -111,18 +106,17 @@ graph TD
|
|
|
111
106
|
fatal: ['*']
|
|
112
107
|
}
|
|
113
108
|
```
|
|
114
|
-
-
|
|
115
|
-
- **Tame Your ORMs with Custom Serializers**: Stop leaking data or polluting logs with massive objects. Define a serializer once for your `Prisma` or `TypeORM` models to ensure that only clean, safe data is ever logged.
|
|
109
|
+
- **🩺 Experimental Doctor CLI**: The `syntropylog doctor` validates SyntropyLog configurations (experimental, in development).
|
|
116
110
|
- **Security by Default**: A powerful, zero-dependency masking engine automatically finds and redacts sensitive data like `"password"` or `"creditCardNumber"` at any level of your log objects, ensuring you stay compliant.
|
|
117
111
|
- **Production-Ready Transports**: Multiple transport options including JSON for production tools and human-readable formats for development environments.
|
|
118
|
-
- **Configuration Validation**:
|
|
112
|
+
- **Configuration Validation**: Built-in validation ensures your configuration is correct and follows best practices.
|
|
119
113
|
</details>
|
|
120
114
|
|
|
121
115
|
---
|
|
122
116
|
|
|
123
117
|
## ⚡ Quick Start
|
|
124
118
|
|
|
125
|
-
> **⚠️ ALPHA VERSION**: This example uses `syntropylog@0.6.
|
|
119
|
+
> **⚠️ ALPHA VERSION**: This example uses `syntropylog@0.6.8`. For production use, wait for stable release.
|
|
126
120
|
|
|
127
121
|
### 🚀 Basic Configuration (Get Started in 30 Seconds)
|
|
128
122
|
|
|
@@ -210,7 +204,7 @@ Ready to see the full power of SyntropyLog? Here's every configuration option av
|
|
|
210
204
|
import { syntropyLog, PrettyConsoleTransport, ClassicConsoleTransport } from 'syntropylog';
|
|
211
205
|
import { AxiosAdapter, FetchAdapter } from '@syntropylog/adapters';
|
|
212
206
|
import { KafkaAdapter, NatsAdapter, RabbitMQAdapter } from '@syntropylog/adapters';
|
|
213
|
-
|
|
207
|
+
// Note: Serializers are available in the separate @syntropylog/adapters package
|
|
214
208
|
import axios from 'axios';
|
|
215
209
|
|
|
216
210
|
await syntropyLog.init({
|
|
@@ -237,11 +231,9 @@ await syntropyLog.init({
|
|
|
237
231
|
// serviceVersion: '1.0.0',
|
|
238
232
|
// }),
|
|
239
233
|
],
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
request: (req) => `${req.method} ${req.url}`,
|
|
244
|
-
},
|
|
234
|
+
// Note: Custom serializers for complex objects
|
|
235
|
+
// user: (user) => `${user.id}:${user.email}`,
|
|
236
|
+
// request: (req) => `${req.method} ${req.url}`,
|
|
245
237
|
serializerTimeoutMs: 50, // Prevent slow serializers from blocking
|
|
246
238
|
prettyPrint: {
|
|
247
239
|
enabled: process.env.NODE_ENV !== 'production',
|
|
@@ -520,14 +512,14 @@ export default [
|
|
|
520
512
|
];
|
|
521
513
|
```
|
|
522
514
|
|
|
523
|
-
####
|
|
524
|
-
-
|
|
525
|
-
-
|
|
526
|
-
-
|
|
527
|
-
-
|
|
528
|
-
-
|
|
515
|
+
#### **🎯 Current Focus:**
|
|
516
|
+
- ✅ **Configuration Validation**: Comprehensive validation of your SyntropyLog setup
|
|
517
|
+
- ✅ **Flexible Rules**: Custom validation rules for your specific needs
|
|
518
|
+
- ✅ **Immediate Feedback**: Instant identification of configuration issues
|
|
519
|
+
- ✅ **Best Practices**: Built-in rules for common configuration patterns
|
|
520
|
+
- ✅ **Extensible System**: Add your own validation rules as needed
|
|
529
521
|
|
|
530
|
-
> **Note**: The doctor focuses on **
|
|
522
|
+
> **Note**: The doctor focuses on **ensuring your SyntropyLog configuration is correct and follows best practices**. Advanced analysis features (performance, security, patterns) are planned for future versions.
|
|
531
523
|
```
|
|
532
524
|
|
|
533
525
|
### 🎯 What This Configuration Gives You
|
|
@@ -540,7 +532,7 @@ export default [
|
|
|
540
532
|
- **🚀 Environment-Aware Transports**: Different logging strategies for dev vs production
|
|
541
533
|
- **⚡ Performance Optimization**: Configurable timeouts and retry strategies
|
|
542
534
|
- **🔧 Framework Agnostic**: Works with any HTTP client, database, or message broker
|
|
543
|
-
- **🩺
|
|
535
|
+
- **🩺 Experimental Diagnostics**: Doctor CLI for configuration validation (experimental, in development)
|
|
544
536
|
- **🏗️ Scalable Architecture**: Support for clusters, sentinels, and distributed systems
|
|
545
537
|
|
|
546
538
|
### 🎭 Logger API Showcase
|
|
@@ -604,11 +596,11 @@ logger
|
|
|
604
596
|
});
|
|
605
597
|
```
|
|
606
598
|
|
|
607
|
-
### 🛡️
|
|
599
|
+
### 🛡️ Security Features
|
|
608
600
|
|
|
609
|
-
#### 📋 **Retention Rules (
|
|
601
|
+
#### 📋 **Retention Rules (Experimental)**
|
|
610
602
|
|
|
611
|
-
SyntropyLog provides flexible retention policies with JSON-based configuration:
|
|
603
|
+
SyntropyLog provides flexible retention policies with JSON-based configuration (experimental feature):
|
|
612
604
|
|
|
613
605
|
```typescript
|
|
614
606
|
// Retention Configuration Enums - Type-safe compliance rules
|
|
@@ -914,7 +906,7 @@ logger.error('Operation failed', {
|
|
|
914
906
|
})
|
|
915
907
|
```
|
|
916
908
|
|
|
917
|
-
### 🚧
|
|
909
|
+
### 🚧 Future Features
|
|
918
910
|
|
|
919
911
|
- **📊 OpenTelemetry Integration**: Seamless logs-to-traces correlation
|
|
920
912
|
- **📈 Custom Metrics**: Built-in metrics collection and reporting
|
|
@@ -934,17 +926,16 @@ npm install @syntropylog/adapters
|
|
|
934
926
|
|
|
935
927
|
### Available Adapters
|
|
936
928
|
- **HTTP Clients**: Axios, Fetch (with custom adapter support)
|
|
937
|
-
- **Message Brokers**: Kafka, NATS, RabbitMQ (
|
|
938
|
-
- **Database Serializers**: Prisma, TypeORM, MySQL, PostgreSQL (
|
|
929
|
+
- **Message Brokers**: Kafka, NATS, RabbitMQ (in development)
|
|
930
|
+
- **Database Serializers**: Prisma, TypeORM, MySQL, PostgreSQL (in development)
|
|
939
931
|
|
|
940
932
|
### Usage Example
|
|
941
933
|
```typescript
|
|
942
934
|
import { syntropyLog } from 'syntropylog';
|
|
943
|
-
import {
|
|
935
|
+
import { AxiosAdapter } from '@syntropylog/adapters';
|
|
944
936
|
|
|
945
937
|
// Use adapters independently
|
|
946
|
-
const
|
|
947
|
-
const kafkaAdapter = new KafkaAdapter({ brokers: ['localhost:9092'] });
|
|
938
|
+
const axiosAdapter = new AxiosAdapter(axios.create());
|
|
948
939
|
```
|
|
949
940
|
|
|
950
941
|
**[📖 Full Adapters Documentation](https://github.com/Syntropysoft/syntropylog-adapters)**
|
|
@@ -977,26 +968,41 @@ Each example is a self-contained project that demonstrates a specific feature, f
|
|
|
977
968
|
|
|
978
969
|
### Example Categories:
|
|
979
970
|
|
|
980
|
-
#### **Foundation (00-09)
|
|
971
|
+
#### **Foundation (00-09)**
|
|
981
972
|
- **00-setup-initialization**: ✅ **Complete** - Application setup and initialization
|
|
982
973
|
- **01-hello-world**: ✅ **Complete** - Basic logging concepts
|
|
983
974
|
- **02-basic-context**: ✅ **Complete** - Context propagation and correlation
|
|
984
975
|
- **03-context-ts**: ✅ **Complete** - TypeScript interfaces and type safety
|
|
985
|
-
|
|
986
|
-
|
|
976
|
+
- **04-logging-levels-transports**: 🚧 **In Development** - Logging levels and transport configuration
|
|
977
|
+
- **05-universal-context-patterns**: 🚧 **In Development** - Universal context patterns for all Node.js applications
|
|
978
|
+
- **06-error-handling**: 🚧 **In Development** - Error handling and logging strategies
|
|
979
|
+
- **07-logger-configuration**: 🚧 **In Development** - Advanced logger configuration patterns
|
|
980
|
+
- **08-logging-matrix**: 🚧 **In Development** - Smart context logging matrix
|
|
981
|
+
- **09-http-configuration**: 🚧 **In Development** - HTTP client configuration patterns
|
|
982
|
+
|
|
983
|
+
#### **HTTP Clients & Redis (10-19)**
|
|
987
984
|
- **10-basic-http-correlation**: ✅ **Complete** - HTTP request correlation with automatic context propagation
|
|
988
985
|
- **11-custom-adapter**: ✅ **Complete** - Custom HTTP adapters for framework-agnostic design
|
|
989
986
|
- **12-http-redis-axios**: ✅ **Complete** - HTTP + Redis + Express with caching
|
|
990
987
|
- **13-http-redis-fastify**: ✅ **Complete** - Framework agnosticism demo (Express vs Fastify)
|
|
991
|
-
|
|
992
|
-
|
|
988
|
+
- **14-http-redis-nestjs**: 🚧 **In Development** - NestJS framework integration
|
|
989
|
+
- **15-http-redis-koa**: 🚧 **In Development** - Koa framework integration
|
|
990
|
+
- **16-http-redis-hapi**: 🚧 **In Development** - Hapi framework integration
|
|
991
|
+
- **17-custom-serializers**: 🚧 **In Development** - Custom data serialization patterns
|
|
992
|
+
- **18-custom-transports**: 🚧 **In Development** - Custom logging transport patterns
|
|
993
|
+
- **19-doctor-cli**: 🚧 **In Development** - Configuration validation with Doctor CLI
|
|
994
|
+
|
|
995
|
+
#### **Message Brokers (20-24) ✅ COMPLETE**
|
|
993
996
|
- **20-basic-kafka-correlation**: ✅ **Tested with Docker** - Kafka message broker integration
|
|
994
997
|
- **21-basic-rabbitmq-broker**: ✅ **Tested with Docker** - RabbitMQ integration
|
|
995
998
|
- **22-basic-nats-broker**: ✅ **Tested with Docker** - NATS integration
|
|
996
|
-
- **23-kafka-full-stack**:
|
|
997
|
-
- **24-full-stack-nats**:
|
|
998
|
-
|
|
999
|
-
|
|
999
|
+
- **23-kafka-full-stack**: ✅ **Complete** - Kafka distributed tracing
|
|
1000
|
+
- **24-full-stack-nats**: ✅ **Complete** - Advanced NATS microservices architecture
|
|
1001
|
+
|
|
1002
|
+
#### **Advanced Patterns (25-29) 🚧 IN DEVELOPMENT**
|
|
1003
|
+
- **25-production-configuration**: 🚧 **In Development** - Production-ready configuration patterns
|
|
1004
|
+
- **26-advanced-context**: 🚧 **In Development** - Advanced context management patterns
|
|
1005
|
+
- **27-complete-enterprise-app**: 🚧 **In Development** - Complete enterprise application example
|
|
1000
1006
|
|
|
1001
1007
|
#### **Backend Frameworks (30-39) 🚧 IN DEVELOPMENT**
|
|
1002
1008
|
- **30-data-masking**: 🚧 **In Progress** - Security and data protection
|
|
@@ -1016,11 +1022,10 @@ Each example is a self-contained project that demonstrates a specific feature, f
|
|
|
1016
1022
|
- **44-private-package-registry**: 🚧 **In Progress** - Package management
|
|
1017
1023
|
- **45-github-packages-consumer**: 🚧 **In Progress** - GitHub packages integration
|
|
1018
1024
|
|
|
1019
|
-
#### **
|
|
1020
|
-
- **
|
|
1021
|
-
- **
|
|
1022
|
-
- **
|
|
1023
|
-
- **53-diagnostics-security**: 🚧 **In Progress** - Security analysis and compliance validation
|
|
1025
|
+
#### **Specialized Features (14-16) 🚧 IN DEVELOPMENT**
|
|
1026
|
+
- **14-redis-configuration**: 🚧 **In Development** - Advanced Redis configuration patterns
|
|
1027
|
+
- **15-message-brokers-configuration**: 🚧 **In Development** - Message broker configuration patterns
|
|
1028
|
+
- **16-data-masking**: 🚧 **In Development** - Data masking and security patterns
|
|
1024
1029
|
|
|
1025
1030
|
---
|
|
1026
1031
|
|
|
@@ -1083,15 +1088,15 @@ npm run format # Format code
|
|
|
1083
1088
|
|
|
1084
1089
|
> **⚠️ ALPHA VERSION WARNING** ⚠️
|
|
1085
1090
|
>
|
|
1086
|
-
> **SyntropyLog is currently in ALPHA phase (0.6.
|
|
1091
|
+
> **SyntropyLog is currently in ALPHA phase (0.6.7).**
|
|
1087
1092
|
>
|
|
1088
1093
|
> - **Not ready for production use**
|
|
1089
1094
|
> - **API may change between versions**
|
|
1090
1095
|
> - **Use for learning and experimentation only**
|
|
1091
|
-
> - **Examples require alpha version: `syntropylog@0.6.
|
|
1096
|
+
> - **Examples require alpha version: `syntropylog@0.6.8`**
|
|
1092
1097
|
|
|
1093
1098
|
```bash
|
|
1094
|
-
npm install syntropylog@0.6.
|
|
1099
|
+
npm install syntropylog@0.6.8
|
|
1095
1100
|
```
|
|
1096
1101
|
|
|
1097
1102
|
## 🔌 Supported Dependencies
|
|
@@ -1101,19 +1106,19 @@ SyntropyLog includes built-in adapters for popular libraries. Here are the suppo
|
|
|
1101
1106
|
### HTTP Clients
|
|
1102
1107
|
- **Axios**: `^1.10.0` ✅ **Built-in adapter**
|
|
1103
1108
|
- **Fetch**: Native browser API ✅ **Custom adapter support**
|
|
1104
|
-
- **Got**: `^12.0.0` (
|
|
1105
|
-
- **Request**: `^2.88.2` (
|
|
1109
|
+
- **Got**: `^12.0.0` (in development)
|
|
1110
|
+
- **Request**: `^2.88.2` (removed in v0.6.0, use adapters instead)
|
|
1106
1111
|
|
|
1107
1112
|
### Message Brokers
|
|
1108
|
-
- **Kafka**: `kafkajs ^2.2.4` (
|
|
1109
|
-
- **RabbitMQ**: `amqplib ^0.10.8` (
|
|
1110
|
-
- **NATS**: `nats ^2.17.0` (
|
|
1113
|
+
- **Kafka**: `kafkajs ^2.2.4` (in development)
|
|
1114
|
+
- **RabbitMQ**: `amqplib ^0.10.8` (in development)
|
|
1115
|
+
- **NATS**: `nats ^2.17.0` (in development)
|
|
1111
1116
|
|
|
1112
1117
|
### Database Serializers
|
|
1113
|
-
- **Prisma**: (
|
|
1114
|
-
- **TypeORM**: (
|
|
1115
|
-
- **MySQL**: (
|
|
1116
|
-
- **PostgreSQL**: (
|
|
1118
|
+
- **Prisma**: (in development)
|
|
1119
|
+
- **TypeORM**: (in development)
|
|
1120
|
+
- **MySQL**: (in development)
|
|
1121
|
+
- **PostgreSQL**: (in development)
|
|
1117
1122
|
|
|
1118
1123
|
### Usage Example
|
|
1119
1124
|
```typescript
|