uranusjr commented on code in PR #71882:
URL: https://github.com/apache/airflow/pull/71882#discussion_r3826349364


##########
go-sdk/README.md:
##########
@@ -202,6 +202,17 @@ func extract(ctx sdk.TIRunContext, log *slog.Logger) (any, 
error) {
 `TryNumber`; `ctx.DagRun()` returns `DagID`, `RunID`, and the `*time.Time` 
fields `LogicalDate`,
 `DataIntervalStart`, and `DataIntervalEnd` (nil when the run has no such 
value, e.g. a manual trigger).
 
+### Task logging
+
+In coordinator mode, the injected logger filters records using Airflow's 
configured `[logging] logging_level` before sending them to the supervisor. 
Airflow also propagates `[logging] namespace_levels`; because `slog` does not 
have named loggers, bind the namespace as the top-level `logger` attribute:
+
+```go
+databaseLog := log.With("logger", "example.database")
+databaseLog.Debug("query complete", "rows", 42)
+```
+
+Namespace levels use longest dotted-prefix matching, so an `example=DEBUG` 
override also applies to `example.database` unless a more specific override 
takes precedence.

Review Comment:
   slog has `log.WithGroup(...)`. Should we do something with it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to