diff --git a/Cargo.lock b/Cargo.lock
index 8ac8d21556..0d45f7133a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2576,7 +2576,6 @@ dependencies = [
"hyper",
"jsonwebtoken",
"lazy_static",
- "log",
"postgres",
"rand",
"routerify",
diff --git a/zenith_utils/Cargo.toml b/zenith_utils/Cargo.toml
index 90810ff5df..e9e12283b9 100644
--- a/zenith_utils/Cargo.toml
+++ b/zenith_utils/Cargo.toml
@@ -11,7 +11,6 @@ byteorder = "1.4.3"
bytes = "1.0.1"
hyper = { version = "0.14.7", features = ["full"] }
lazy_static = "1.4.0"
-log = "0.4.14"
postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="9eb0dbfbeb6a6c1b79099b9f7ae4a8c021877858" }
routerify = "2"
serde = { version = "1.0", features = ["derive"] }
diff --git a/zenith_utils/src/http/endpoint.rs b/zenith_utils/src/http/endpoint.rs
index 30e7bfc921..9c35f77328 100644
--- a/zenith_utils/src/http/endpoint.rs
+++ b/zenith_utils/src/http/endpoint.rs
@@ -9,6 +9,7 @@ use routerify::ext::RequestExt;
use routerify::RequestInfo;
use routerify::{Middleware, Router, RouterBuilder, RouterService};
use std::net::TcpListener;
+use tracing::info;
use zenith_metrics::{new_common_metric_name, register_int_counter, IntCounter};
use zenith_metrics::{Encoder, TextEncoder};
@@ -32,7 +33,7 @@ lazy_static! {
}
async fn logger(res: Response
, info: RequestInfo) -> Result, ApiError> {
- log::info!("{} {} {}", info.method(), info.uri().path(), res.status(),);
+ info!("{} {} {}", info.method(), info.uri().path(), res.status(),);
Ok(res)
}
@@ -163,7 +164,7 @@ pub fn serve_thread_main(
router_builder: RouterBuilder,
listener: TcpListener,
) -> anyhow::Result<()> {
- log::info!("Starting a http endpoint at {}", listener.local_addr()?);
+ info!("Starting a http endpoint at {}", listener.local_addr()?);
// Create a Service from the router above to handle incoming requests.
let service = RouterService::new(router_builder.build().map_err(|err| anyhow!(err))?).unwrap();
diff --git a/zenith_utils/src/http/error.rs b/zenith_utils/src/http/error.rs
index 74239ab86c..7b5e0eb9b0 100644
--- a/zenith_utils/src/http/error.rs
+++ b/zenith_utils/src/http/error.rs
@@ -69,7 +69,7 @@ impl HttpErrorBody {
}
pub async fn handler(err: routerify::RouteError) -> Response {
- log::error!("{}", err);
+ tracing::error!("{}", err);
err.downcast::()
.expect("handler should always return api error")
.into_response()
diff --git a/zenith_utils/src/postgres_backend.rs b/zenith_utils/src/postgres_backend.rs
index 02eb330f3b..7950eee7bd 100644
--- a/zenith_utils/src/postgres_backend.rs
+++ b/zenith_utils/src/postgres_backend.rs
@@ -7,7 +7,6 @@ use crate::pq_proto::{BeMessage, FeMessage, FeStartupMessage, StartupRequestCode
use crate::sock_split::{BidiStream, ReadStream, WriteStream};
use anyhow::{anyhow, bail, ensure, Result};
use bytes::{Bytes, BytesMut};
-use log::*;
use rand::Rng;
use serde::{Deserialize, Serialize};
use std::io::{self, Write};
@@ -16,6 +15,7 @@ use std::str::FromStr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time::Duration;
+use tracing::*;
static PGBACKEND_SHUTDOWN_REQUESTED: AtomicBool = AtomicBool::new(false);