Format logs of Apollo Router

Hi all,

We use GraphQL Federation 2.0 and have a Self Hosted Supergraph-Subgraph setup.
For observability purposes, we would like to format the logs of Router.

We have tried with adding post processor RHAI script but no success.

Has anyone tried this ? Any help is welcome.

Thanks a million

Hello, Using the Router log exporter you can add new attributes to be included in your text logs: Router Logging - Apollo GraphQL Docs

If you want to change the format from text to JSON you can also do that via configuration: Router Logging to stdout - Apollo GraphQL Docs

For more advanced configuration you can create also create events which can be hooked into the predefined layers for Router Core: Events - Apollo GraphQL Docs

Or you can create custom event triggers if you are a GraphOS enterprise user: Events - Apollo GraphQL Docs