-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a290e8
commit 2761cc1
Showing
9 changed files
with
443 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod configuration; | ||
pub mod routes; | ||
pub mod startup; | ||
pub mod telemetry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use tracing::level_filters::LevelFilter; | ||
use tracing_subscriber::{ | ||
fmt::{self, format::FmtSpan}, | ||
layer::SubscriberExt, | ||
util::SubscriberInitExt, | ||
Layer, | ||
}; | ||
|
||
pub fn init_tracing() { | ||
// console layer for tracing-subscriber | ||
let console = fmt::Layer::new() | ||
.with_span_events(FmtSpan::CLOSE) | ||
.json() | ||
.with_filter(LevelFilter::DEBUG); | ||
|
||
// file appender layer for tracing-subscriber | ||
let file_appender = tracing_appender::rolling::daily("./", "zero2prod.log"); | ||
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender); | ||
let file = fmt::Layer::new() | ||
.with_writer(non_blocking) | ||
.json() | ||
.with_filter(LevelFilter::DEBUG); | ||
|
||
tracing_subscriber::registry() | ||
.with(console) | ||
.with(file) | ||
.init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.