-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add JSON log #298
Add JSON log #298
Conversation
FYI: GitHub behaves really weird for me. It shows me that I did 9 commits when I only did 1. The other commits are from an entirely different branch. When I try to merge this branch locally, everything behaves as intended and only the 1 commit gets merged in. So this might just be a visual bug. |
It looks like you've based c996dc0 on the vconnection branch. You've merged master into |
c996dc0
to
1d94ea7
Compare
Thanks for the tip! This (as you can see 😁) worked! |
166bac9
to
1133b79
Compare
lib/rig/application.ex
Outdated
# TODO: Fix format; context: config.exs:94 | ||
# Or can I leave it like that? The only difference seems to | ||
# be that the level and the module are switched | ||
Logger.add_backend(:console) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the config for console is not used here? You could try to set the values using Application.put_env, which should basically do the same..
It would be good to respect the config setting if possible, because it deduplicates the meta data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? I meant that the format specified in config.exs doesn't apply here. I can fix metadata just by setting :metadata
to :all
. I don't think I can set the format through an env var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean environment variables - see https://hexdocs.pm/elixir/Application.html#put_env/4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that the format specified in config.exs doesn't apply here. I can fix metadata just by setting :metadata to :all.
Why can't you apply the previous config here? Not sure what you mean..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm...it appears to work now...for some reason...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like...it produces the same result (log-wise) as the master branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinbader Is this closable then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please double check whether it actually works now ;) but yes, if it really works, sure
@kevinbader Shall I maybe add a paragraph in |
@Azer0s please merge with current master.
|
915199d
to
9a483cd
Compare
Co-authored-by: Ariel Simulevski <Azer0s@users.noreply.github.com>
9a483cd
to
cbbcefe
Compare
Description
JSON Log is not only a nice to have, for many scenarios it is also an important requirement. The goal of this PR is to introduce two new kinds of loggers into RIG, as well as a new environment variable.
With
LOG_TYPE
, you should be able to control what kind of log RIG produces on STDOUT. This can either beerlang
(this is the default and is set if the environment variable is not set),json
(this is basic JSON, nothing too fancy here) andgcl
(which is the Google Cloud Logger LogEntry format).TODO
Maybe not use a 3rd party lib (?)What to look out for
Dear reviewer, I want you to
Process
The goal is to improve not only the code in this PR but also our skills! The "rules":
Have fun!