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

Support GELF logging output. #497

Merged
merged 1 commit into from
Jun 20, 2019
Merged

Conversation

jbgi
Copy link
Contributor

@jbgi jbgi commented Jun 14, 2019

Closes #447.

jormungandr/Cargo.toml Outdated Show resolved Hide resolved
jormungandr/src/settings/logging.rs Outdated Show resolved Hide resolved
@jbgi jbgi force-pushed the slog-gelf branch 2 times, most recently from bb1a33f to 34497a6 Compare June 14, 2019 15:43
@disassembler
Copy link
Contributor

I've rebased in my fork (disassembler) but have no way to push to this PR.

jormungandr/src/main.rs Outdated Show resolved Hide resolved
@jbgi jbgi force-pushed the slog-gelf branch 2 times, most recently from b6e4f33 to d48a826 Compare June 17, 2019 11:06
@NicolasDP
Copy link
Contributor

This UUID will be generated every time at start up. Is this what you really want?

How will the user be aware of the UUID to give to get support?

What about re-using the same UUID? Since this is a feature Devops wishes to include, why not have it set as parameter when starting GELF logging and have it generated by the devops script side of things?

@mzabaluev
Copy link
Contributor

I would provide the GELF logging id as an option in the config.yaml option map for GELF.

@jbgi
Copy link
Contributor Author

jbgi commented Jun 17, 2019

Yes, I was thinking of adding an identifier parameter (should the name be more gelf specific like gelf_source?) that would default to the generated uuid (and have it printed to stderr). But now I agree that it is simpler to just provide the id externally (and make it mandatory when using gelf). Will update.

@jbgi jbgi force-pushed the slog-gelf branch 2 times, most recently from b11a512 to b36d16a Compare June 17, 2019 12:45
jormungandr/Cargo.toml Outdated Show resolved Hide resolved
@mzabaluev mzabaluev mentioned this pull request Jun 18, 2019
@jbgi jbgi force-pushed the slog-gelf branch 3 times, most recently from f04a932 to 7e5fabd Compare June 18, 2019 08:14
iohk-bors bot added a commit to input-output-hk/iohk-nix that referenced this pull request Jun 18, 2019
100: Add jormungandrMaster for non-released build of jormungandr r=jbgi a=jbgi

currently pointing at this PR: input-output-hk/jormungandr#497

Co-authored-by: Jean-Baptiste Giraudeau <[email protected]>
@jbgi
Copy link
Contributor Author

jbgi commented Jun 18, 2019

should be mergeable now.

@vincenthz
Copy link
Member

I think this is looking good, but it's missing a configurability option to make the gelf support optional

@@ -24,6 +24,8 @@ pub struct ConfigLogSettings {
pub verbosity: Option<u8>,
pub format: Option<LogFormat>,
pub output: Option<LogOutput>,
pub backend: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

that might be better as an Enum related to gelf instead of a random string.

@@ -24,6 +24,8 @@ pub struct ConfigLogSettings {
pub verbosity: Option<u8>,
pub format: Option<LogFormat>,
pub output: Option<LogOutput>,
pub backend: Option<String>,
pub logs_id: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

same thing

@@ -28,6 +31,7 @@ pub enum LogFormat {
/// Output of the logger.
pub enum LogOutput {
Stderr,
Gelf,
Copy link
Member

@vincenthz vincenthz Jun 20, 2019

Choose a reason for hiding this comment

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

seems that if you make this Gelf(String, String) you same yourself the trouble of extending the generic structure for something specific to the backend

Copy link
Contributor

Choose a reason for hiding this comment

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

The structopt/YAML thing would need to be customized for this, I believe.

This whole enum needs love, but I can improve it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I was not sure how the yaml parsing would workout if I did that. I can try.

Copy link
Member

Choose a reason for hiding this comment

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

ok nevermind, if it's too complicated we can push this through and revisit later

@mzabaluev
Copy link
Contributor

@vincenthz should we expect @jbgi to do the right cfg/optional dependency thing, or is it something we can do as a follow-up change?

@jbgi
Copy link
Contributor Author

jbgi commented Jun 20, 2019

it's missing a configurability option to make the gelf support optional

@vincenthz so a feature like for journald support?

@vincenthz
Copy link
Member

I don't mind too much on the order, it should be easy to cfg() is out, so that it doesn't impose some transitient unseen burden

@vincenthz vincenthz merged commit bebd3a3 into input-output-hk:master Jun 20, 2019
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.

gelf logging support for slog
5 participants