You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.9.0] - 2026-01-09
9
+
10
+
### Added
11
+
-**Tracing support**: New `tracing` feature flag enables tracing/tracing-subscriber integration as an alternative to env_logger
12
+
-**Configurable logging initialization**: New `log_init = function_name` macro parameter allows custom log initialization functions instead of relying on defaults
13
+
-**Event logging control**: New `event_logging = bool` macro parameter controls whether Lambda event payloads are logged (defaults to `false` for better security)
14
+
- Structured JSON logging by default when tracing is enabled
15
+
-`#[tracing::instrument]` attributes on generated handler functions with request ID and operation name in trace spans
16
+
- Signature validation for the `hook` option with clear error messages for invalid function signatures
17
+
18
+
### Changed
19
+
-**Breaking**: Event payload logging is now disabled by default for security reasons (can be re-enabled with `event_logging = true`)
20
+
- When Lambda event payloads logging is enabled, Lambda event payloads are now logged at `debug` level instead of `info`
21
+
-`env_logger` is now an optional feature (still enabled by default for backward compatibility)
22
+
- Independent `log` feature flag controls log statement generation in generated code
23
+
24
+
### Fixed
25
+
- Generated `main` and `function_handler` now use fully qualified `::core::result::Result` instead of `Result`, preventing compilation failures when users override the Result type
26
+
- Request hook trybuild test was not actually testing anything
27
+
- Release CI could fail tests but still proceed with publishing
Error types and messages are extracted from AWS SDK error metadata, allowing use of the `?` operator with AWS SDK calls for properly formatted AppSync response errors.
255
257
258
+
### Logging Configuration
259
+
260
+
The framework provides flexible logging configuration with support for both `env_logger` (default) and `tracing`.
261
+
262
+
#### Default Logging (env_logger)
263
+
264
+
By default, lambda-appsync uses `env_logger`:
265
+
266
+
```rust
267
+
appsync_lambda_main!(
268
+
"graphql/schema.gql",
269
+
dynamodb() ->aws_sdk_dynamodb::Client,
270
+
);
271
+
```
272
+
273
+
#### Custom Log Initialization
274
+
275
+
Override the default logging setup with a custom function:
276
+
277
+
```rust
278
+
fncustom_log_init() {
279
+
uselambda_appsync::env_logger;
280
+
env_logger::Builder::from_env(
281
+
env_logger::Env::default()
282
+
.default_filter_or("info,tracing::span=warn")
283
+
.default_write_style_or("never"),
284
+
)
285
+
.format_timestamp_micros()
286
+
.init();
287
+
}
288
+
289
+
appsync_lambda_main!(
290
+
"graphql/schema.gql",
291
+
log_init=custom_log_init,
292
+
dynamodb() ->aws_sdk_dynamodb::Client,
293
+
);
294
+
```
295
+
296
+
#### Tracing Support
297
+
298
+
Enable structured JSON logging with tracing by adding the `tracing` feature:
299
+
300
+
```toml
301
+
[dependencies]
302
+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["tracing"] }
303
+
```
304
+
305
+
```rust
306
+
fntracing_init() {
307
+
uselambda_appsync::{tracing, tracing_subscriber};
308
+
tracing_subscriber::fmt()
309
+
.json()
310
+
.with_env_filter(
311
+
tracing_subscriber::EnvFilter::from_default_env()
312
+
.add_directive(tracing::Level::INFO.into()),
313
+
)
314
+
.with_current_span(false)
315
+
.with_ansi(false)
316
+
.with_target(false)
317
+
.init();
318
+
}
319
+
320
+
appsync_lambda_main!(
321
+
"graphql/schema.gql",
322
+
log_init=tracing_init,
323
+
dynamodb() ->aws_sdk_dynamodb::Client,
324
+
);
325
+
```
326
+
327
+
#### Event Logging Control
328
+
329
+
Control whether Lambda event payloads are logged (disabled by default for security):
330
+
331
+
```rust
332
+
appsync_lambda_main!(
333
+
"graphql/schema.gql",
334
+
event_logging=true, // Enable full event payload logging for debugging
335
+
dynamodb() ->aws_sdk_dynamodb::Client,
336
+
);
337
+
```
338
+
256
339
### Error Merging
257
340
258
341
Combine multiple errors using the pipe operator:
@@ -262,6 +345,27 @@ let err = AppsyncError::new("ValidationError", "Invalid email")
262
345
|AppsyncError::new("DatabaseError", "User not found");
263
346
```
264
347
348
+
### Feature Flags
349
+
350
+
The `lambda-appsync` crate supports several feature flags for different use cases:
351
+
352
+
-`env_logger` (default): Enables env_logger integration and re-exports
353
+
-`tracing`: Enables tracing/tracing-subscriber integration as an alternative to env_logger
354
+
-`log`: Controls log statement generation in generated code and availability of re-exported `log` crate
355
+
356
+
You can mix and match these features based on your needs:
357
+
358
+
```toml
359
+
# Use tracing instead of env_logger
360
+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["tracing"] }
361
+
362
+
# Use both (for migration scenarios)
363
+
lambda-appsync = { version = "0.9.0", features = ["tracing"] }
364
+
365
+
# Use your custom logging framework while still getting logs from the macro-generated code
366
+
lambda-appsync = { version = "0.9.0", default-features = false, features = ["log"] }
0 commit comments