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

services/horizon: Allow customization of the Captive Core log file. #3472

Merged
merged 7 commits into from
Mar 19, 2021

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Mar 18, 2021

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

This introduces the --captive-core-log-path parameter, which sets Stellar Core's LOG_FILE_PATH in the auto-generated configuration accordingly. If it's not set, Horizon will continue to log Captive Core's output to its log path with subservice=stellar-core.

Why

Closes #3438

Known limitations

n/a

Shaptic added 2 commits March 17, 2021 16:57
Now, we either log to Horizon's subservice=stellar-core or we pass
along to Stellar-Core's LOG_FILE_PATH="..." based on the value of
the above parameter.
@Shaptic Shaptic added this to the Horizon 2.1.0 milestone Mar 18, 2021
@Shaptic Shaptic requested a review from a team March 18, 2021 00:55
@Shaptic Shaptic self-assigned this Mar 18, 2021
ingest/ledgerbackend/captive_core_backend.go Outdated Show resolved Hide resolved
services/horizon/internal/flags.go Outdated Show resolved Hide resolved
Comment on lines 72 to 77
CaptiveCoreBinaryPath: app.config.CaptiveCoreBinaryPath,
CaptiveCoreConfigAppendPath: app.config.CaptiveCoreConfigAppendPath,
CaptiveCoreHTTPPort: app.config.CaptiveCoreHTTPPort,
CaptiveCoreLogPath: app.config.CaptiveCoreLogPath,
RemoteCaptiveCoreURL: app.config.RemoteCaptiveCoreURL,
EnableCaptiveCore: app.config.EnableCaptiveCoreIngestion,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an informational question, why do we do this, rather than passing along app.config directly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's clear which global config variables are used by the component. I know that we sometimes pass entire config in other places in Horizon but I believe we should only pass specific values.

services/horizon/internal/flags.go Outdated Show resolved Hide resolved
Comment on lines 72 to 77
CaptiveCoreBinaryPath: app.config.CaptiveCoreBinaryPath,
CaptiveCoreConfigAppendPath: app.config.CaptiveCoreConfigAppendPath,
CaptiveCoreHTTPPort: app.config.CaptiveCoreHTTPPort,
CaptiveCoreLogPath: app.config.CaptiveCoreLogPath,
RemoteCaptiveCoreURL: app.config.RemoteCaptiveCoreURL,
EnableCaptiveCore: app.config.EnableCaptiveCoreIngestion,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's clear which global config variables are used by the component. I know that we sometimes pass entire config in other places in Horizon but I believe we should only pass specific values.

Shaptic and others added 2 commits March 19, 2021 11:54
@Shaptic Shaptic merged commit 5df6246 into stellar:master Mar 19, 2021
@Shaptic Shaptic deleted the custom-core-logging branch March 19, 2021 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting LOG_FILE_PATH when starting Stellar-Core in captive mode
3 participants