Skip to content

Commit dc2b7aa

Browse files
committed
fix: restore JSON string format for CloudWatch compatibility
1 parent a15e841 commit dc2b7aa

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
## [1.7.1](https://github.com/typelets/typelets-api/compare/v1.7.0...v1.7.1) (2025-10-15)
22

3-
43
### Bug Fixes
54

6-
* output structured logs for New Relic log forwarding ([9d004a4](https://github.com/typelets/typelets-api/commit/9d004a406b0de701a09fac9b3e9fdff767e75133))
5+
- output structured logs for New Relic log forwarding ([9d004a4](https://github.com/typelets/typelets-api/commit/9d004a406b0de701a09fac9b3e9fdff767e75133))
76

87
# [1.7.0](https://github.com/typelets/typelets-api/compare/v1.6.2...v1.7.0) (2025-10-15)
98

src/lib/logger.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ class Logger {
3838
return level.priority <= this.currentLogLevel.priority;
3939
}
4040

41-
private formatLog(
42-
level: string,
43-
message: string,
44-
meta: LogMetadata = {}
45-
): Record<string, unknown> {
46-
return {
41+
private formatLog(level: string, message: string, meta: LogMetadata = {}): string {
42+
const logEntry = {
4743
timestamp: new Date().toISOString(),
4844
level,
4945
service: this.service,
@@ -52,6 +48,8 @@ class Logger {
5248
message,
5349
...meta,
5450
};
51+
52+
return JSON.stringify(logEntry);
5553
}
5654

5755
error(message: string, meta: LogMetadata = {}, error?: Error): void {

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// This file is automatically updated by semantic-release
2-
export const VERSION = "1.7.1"
2+
export const VERSION = "1.7.1";

0 commit comments

Comments
 (0)