spinframework / spinframework/spin

prefix log lines with spin and component-id

Open
#1,116 6 comments 1 reaction 1 assignee View on GitHub

@michelleN is already working on this.

Since Sep 26, 2023.

enhancement
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

It's hard to tell which log lines output comes from Spin vs from the actual application (a component). It'd be nice to prefix log lines output with this information: [Spin] and [Component-ID]

For example, if we were to the run the example http rust app which has a single component called hello, the logs looks like this:

Serving http://127.0.0.1:3000
Available Routes:
  hello: http://127.0.0.1:3000 (wildcard)
{"host": "127.0.0.1:3000", "connection": "keep-alive", ... "spin-path-info": "/", "spin-full-url": "http://127.0.0.1:3000/", "spin-matched-route": "/...", "spin-base-path": "/", "spin-raw-component-route": "/...", "spin-component-route": ""}

With the component-id and spin prefixes, the logs output would look like this.

$ spin up
[Spin] Serving http://127.0.0.1:3000
[Spin] Available Routes:
  hello: http://127.0.0.1:3000 (wildcard)
[hello] {"host": "127.0.0.1:3000", "connection": "keep-alive", ... "spin-path-info": "/", "spin-full-url": "http://127.0.0.1:3000/", "spin-matched-route": "/...", "spin-base-path": "/", "spin-raw-component-route": "/...", "spin-component-route": ""}

Would appreciate any feedback here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.