Run server in docker container, added log file
This commit is contained in:
@@ -68,9 +68,15 @@ async fn main() -> Result<()> {
|
||||
dotenv().ok();
|
||||
let env_log_filter =
|
||||
env::var("RUST_LOG").unwrap_or_else(|_| "warp=info,bazaar_realm_api=info".to_owned());
|
||||
let file_appender = tracing_appender::rolling::hourly(
|
||||
env::var("LOG_DIR").unwrap_or_else(|_| ".".to_owned()),
|
||||
"bazaarrealm.log",
|
||||
);
|
||||
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(env_log_filter)
|
||||
.with_span_events(FmtSpan::CLOSE)
|
||||
.with_writer(non_blocking)
|
||||
.init();
|
||||
|
||||
let host = env::var("HOST").expect("`HOST` environment variable not defined");
|
||||
|
||||
Reference in New Issue
Block a user