demo-rust-axum-tracing-subscriber

Demo of Rust and Axum and Tokio tracing subscriber

https://github.com/joelparkerhenderson/demo-rust-axum-tracing-subscriber

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Demo of Rust and Axum and Tokio tracing subscriber

Basic Info
  • Host: GitHub
  • Owner: joelparkerhenderson
  • Language: Rust
  • Default Branch: main
  • Size: 10.7 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

Demo Rust Axum + tracing subscriber

Edit file Cargo.toml.

Add dependencies:

toml axum = { version = "0.7.5" } # Web framework that focuses on ergonomics and modularity. tokio = { version = "1.40.0", features = ["full"] } # Event-driven, non-blocking I/O platform. tracing = { version = "0.1.40" } # Application-level tracing for Rust. tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } # Utilities for implementing and composing ```

Edit file main.rs.

Add code to use tracing:

```rust /// Use tracing crates for application-level tracing output. use tracing_subscriber::{ layer::SubscriberExt, util::SubscriberInitExt, };

[tokio::main]

pub async fn main() { // Start tracing. tracingsubscriber::registry() .with(tracingsubscriber::fmt::layer()) .init(); // Trace an event outside of any span context. tracing::event!(tracing::Level::INFO, "main"); } ```

Try the demo…

Shell:

sh cargo run

You should see console output that shows tracing such as:

sh 2024-08-31T18:19:55.892163Z INFO demo_rust_axum_tracing_subscriber: main

Owner

  • Name: Joel Parker Henderson
  • Login: joelparkerhenderson
  • Kind: user
  • Location: California

Software developer. Technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.

Citation (CITATION.cff)

cff-version: 1.2.0
title: Demo Rust Axum + tracing subscriber
message: >-
  If you use this work and you want to cite it,
  then you can use the metadata from this file.
type: software
authors:
  - given-names: Joel Parker
    family-names: Henderson
    email: joel@joelparkerhenderson.com
    affiliation: joelparkerhenderson.com
    orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
  - type: url
    value: 'https://github.com/joelparkerhenderson/demo-rust-axum-tracing-subscriber/'
    description: Demo Rust Axum + tracing subscriber
repository-code: 'https://github.com/joelparkerhenderson/demo-rust-axum-tracing-subscriber/'
abstract: >-
  Demo Rust Axum + tracing subscriber
license: See license file

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 3
  • Total Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joel Parker Henderson j****l@j****m 3
Committer Domains (Top 20 + Academic)

Dependencies

Cargo.lock cargo
  • 101 dependencies
Cargo.toml cargo