mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 07:57:01 +00:00
add logs
This commit is contained in:
@@ -13,7 +13,7 @@ use http::HeaderMap;
|
|||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use s3s::dto::StreamingBlob;
|
use s3s::dto::StreamingBlob;
|
||||||
use s3s::Body;
|
use s3s::Body;
|
||||||
use tracing::error;
|
use tracing::{error, warn};
|
||||||
|
|
||||||
pub const CONFIG_PREFIX: &str = "config";
|
pub const CONFIG_PREFIX: &str = "config";
|
||||||
const CONFIG_FILE: &str = "config.json";
|
const CONFIG_FILE: &str = "config.json";
|
||||||
@@ -101,9 +101,12 @@ pub async fn read_config_without_migrate(api: &ECStore) -> Result<Config> {
|
|||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if is_not_found(&err) {
|
if is_not_found(&err) {
|
||||||
|
warn!("config not found init start");
|
||||||
let cfg = new_and_save_server_config(api).await?;
|
let cfg = new_and_save_server_config(api).await?;
|
||||||
|
warn!("config not found init done");
|
||||||
return Ok(cfg);
|
return Ok(cfg);
|
||||||
} else {
|
} else {
|
||||||
|
error!("read config err {:?}", &err);
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,9 +123,12 @@ async fn read_server_config(api: &ECStore, data: &[u8]) -> Result<Config> {
|
|||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if is_not_found(&err) {
|
if is_not_found(&err) {
|
||||||
|
warn!("config not found init start");
|
||||||
let cfg = new_and_save_server_config(api).await?;
|
let cfg = new_and_save_server_config(api).await?;
|
||||||
|
warn!("config not found init done");
|
||||||
return Ok(cfg);
|
return Ok(cfg);
|
||||||
} else {
|
} else {
|
||||||
|
error!("read config err {:?}", &err);
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-3
@@ -24,7 +24,7 @@ use service::hybrid;
|
|||||||
use std::{io::IsTerminal, net::SocketAddr, str::FromStr};
|
use std::{io::IsTerminal, net::SocketAddr, str::FromStr};
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tonic::{metadata::MetadataValue, Request, Status};
|
use tonic::{metadata::MetadataValue, Request, Status};
|
||||||
use tracing::{debug, info};
|
use tracing::{debug, error, info, warn};
|
||||||
use tracing_error::ErrorLayer;
|
use tracing_error::ErrorLayer;
|
||||||
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt};
|
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
||||||
@@ -134,7 +134,6 @@ async fn run(opt: config::Opt) -> Result<()> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let rpc_service = NodeServiceServer::with_interceptor(make_server(), check_auth);
|
let rpc_service = NodeServiceServer::with_interceptor(make_server(), check_auth);
|
||||||
info!(" init store success!");
|
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let hyper_service = service.into_shared();
|
let hyper_service = service.into_shared();
|
||||||
@@ -184,7 +183,11 @@ async fn run(opt: config::Opt) -> Result<()> {
|
|||||||
.await
|
.await
|
||||||
.map_err(|err| Error::from_string(err.to_string()))?;
|
.map_err(|err| Error::from_string(err.to_string()))?;
|
||||||
|
|
||||||
store.init().await.map_err(|err| Error::from_string(err.to_string()))?;
|
store.init().await.map_err(|err| {
|
||||||
|
error!("init faild {:?}", &err);
|
||||||
|
Error::from_string(err.to_string())
|
||||||
|
})?;
|
||||||
|
warn!(" init store success!");
|
||||||
// init scanner
|
// init scanner
|
||||||
init_data_scanner().await;
|
init_data_scanner().await;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ use ecstore::bucket::policy_sys::PolicySys;
|
|||||||
use ecstore::bucket::tagging::decode_tags;
|
use ecstore::bucket::tagging::decode_tags;
|
||||||
use ecstore::bucket::tagging::encode_tags;
|
use ecstore::bucket::tagging::encode_tags;
|
||||||
use ecstore::bucket::versioning_sys::BucketVersioningSys;
|
use ecstore::bucket::versioning_sys::BucketVersioningSys;
|
||||||
use ecstore::disk::error::DiskError;
|
|
||||||
use ecstore::new_object_layer_fn;
|
use ecstore::new_object_layer_fn;
|
||||||
use ecstore::options::extract_metadata;
|
use ecstore::options::extract_metadata;
|
||||||
use ecstore::options::put_opts;
|
use ecstore::options::put_opts;
|
||||||
@@ -46,7 +45,6 @@ use s3s::S3;
|
|||||||
use s3s::{S3Request, S3Response};
|
use s3s::{S3Request, S3Response};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use tracing::debug;
|
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
use transform_stream::AsyncTryStream;
|
use transform_stream::AsyncTryStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user