Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add grpc specific log file #6524

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion applications/minotari_node/log4rs_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ appenders:
encoder:
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m} // {f}:{L}{n}"


# An appender named "base_layer" that writes to a file with a custom pattern encoder
base_layer:
kind: rolling_file
Expand All @@ -71,6 +70,23 @@ appenders:
encoder:
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [{X(node-public-key)},{X(node-id)}] {l:5} {m} // {f}:{L}{n}"

# An appender named "base_layer" that writes to a file with a custom pattern encoder
grpc:
kind: rolling_file
path: "{{log_dir}}/log/base_node/grpc.log"
policy:
kind: compound
trigger:
kind: size
limit: 10mb
roller:
kind: fixed_window
base: 1
count: 5
pattern: "{{log_dir}}/log/base_node/grpc.{}.log"
encoder:
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} {l:5} {m} // {f}:{L}{n}"

# An appender named "other" that writes to a file with a custom pattern encoder
other:
kind: rolling_file
Expand Down Expand Up @@ -104,6 +120,11 @@ loggers:
- other
additive: false

minotari::base_node::grpc:
level: debug
appenders:
- grpc

# Route log events sent to the "core" logger to the "base_layer" appender
c:
level: debug
Expand Down
2 changes: 2 additions & 0 deletions applications/minotari_node/src/grpc/base_node_grpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
let page_iter =
NonOverlappingIntegerPairIter::new(start_height, end_height.saturating_add(1), GET_DIFFICULTY_PAGE_SIZE)
.map_err(|e| obscure_error_if_true(report_error_flag, Status::invalid_argument(e)))?;

debug!(target: LOG_TARGET, "Starting GetNetworkDifficulty request from {} to {}", start_height, end_height);
task::spawn(async move {
for (start, end) in page_iter {
// headers are returned by height
Expand Down
1 change: 1 addition & 0 deletions src/nodeenv
Submodule nodeenv added at a6585e
Loading