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

Init tracing log should use provided log_dir_path #239

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

0ex-d
Copy link
Contributor

@0ex-d 0ex-d commented Jan 15, 2025

Correctly pass in LogsSettings log_dir_path field for extensibility. If not set or defined it would fallback to default as shown below:

impl Default for LogsSettings {
fn default() -> Self {
LogsSettings {
log_dir_path: default_log_dir_path(),

Closes #237

@ltitanb
Copy link
Collaborator

ltitanb commented Jan 15, 2025

Thanks, for future reference this works also because of

// Override log dir path if env var is set
if let Some(log_config) = config.logs.as_mut() {
if let Some(log_dir) = load_optional_env_var(LOGS_DIR_ENV) {
log_config.log_dir_path = log_dir.into();
}
}

by itself the path in the config file would not work if running inside docker, but this is overridden with LOGS_DIR_ENV (which is set in the init phase)

@0ex-d
Copy link
Contributor Author

0ex-d commented Jan 15, 2025

Thanks for clarifying this, I'm using this as a pre-cursor to close an issue at Bolt boost client, I can't find the issue atm

@0ex-d
Copy link
Contributor Author

0ex-d commented Jan 15, 2025

Ah found it chainbound/bolt#271

@ltitanb
Copy link
Collaborator

ltitanb commented Jan 16, 2025

Can you please fix lint?

@0ex-d
Copy link
Contributor Author

0ex-d commented Jan 16, 2025

thanks 7671e95

@ltitanb ltitanb merged commit a0bf67c into Commit-Boost:main Jan 16, 2025
4 checks passed
@0ex-d 0ex-d deleted the fix/init-tracing-log-config branch January 16, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracing logger should use config directory or fallback to default
2 participants