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
Initial logger support #2230
Initial logger support #2230
Conversation
Some decisions to make (among others I guess): What about SASL? Currently it works with logger_sasl_compatible, but it would be possible to work without, either by let SASL write to the std-log (it writes as INFO, maybe we should move to NOTICE instead of info?), by keeping logger_sasl_compatible or having a seperate logger to a to-be-defined SASL file. How should the output format look like? The default is: 2023-12-10T19:48:46.972961+01:00 info: Try to start vmq_swc: ok What changes should the CLI support? ... |
(the failing tests are currently kind of expected. Didn't work yet on get them running |
700d2f7
to
6a855fb
Compare
Structured Logs Yes/No (would mean more refactoring) |
f130386
to
ed5c6be
Compare
@mths1 awesome to have a go at this! For interested parties, a couple of links: https://www.erlang.org/doc/apps/kernel/logger_chapter |
ed5c6be
to
eec4be9
Compare
Latest version does not need advanced_config anymore. Works now for console (file and real console) and error logging. Still investigating crash log and syslog... |
eec4be9
to
b12b1fd
Compare
My latest idea: We could also include sasl progress reports into console, but it might then be better to upgrade our log_info to log_notice, so that we could filter them away with log_level notice. Regressions:
|
@mths1 @codeadict do you think structured logging should be part of the deal right from the beginning here? or got at it incrementally? |
97f8c76
to
70fd0c0
Compare
Latest version to test:
Next step would be to decide on the formatting. I added some config for keeping the default or switch to something similar to the previous format. |
5554958
to
db07c50
Compare
Awesome! |
341cd06
to
c34c7aa
Compare
b95bc89
to
da5f6b5
Compare
@ioolkos : Yes, you are right. Seems i copied the wrong link from somewhere. Good news, also works with the other library. I added a json formatter (which is based on the one from rabbitmq). I won't work much on this anymore for now. It is ready for testing. Unless, we want to move to structured logging I assume there shouldn't be too many open points left. |
https://github.com/schlagert/syslog is definitely better and well maintained and tested, structured logs could be a different PR, not necessary for V1 |
@@ -17,5 +17,5 @@ | |||
%%Eonblast hasn't merged the Erlang 18 related PR from djustinek | |||
%%{emysql, {git, "git://github.com/Eonblast/Emysql.git", {tag, "v0.4.1"}}}, | |||
{mongodb, {git, "https://github.com/comtihon/mongodb-erlang.git", {ref, "713e8bd"}}}, | |||
{mcd, {git, "https://github.com/EchoTeam/mcd.git", {ref, "b5b4a32"}}} | |||
{mcd, {git, "https://github.com/mths1/mcd.git", {branch, "master"}}} |
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.
should this be in this 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.
I'd prefer to move mcd to vernemq repro (this is a mcd version without lager dependency)
apps/vmq_server/src/vmq_metadata.erl
Outdated
@@ -42,7 +43,7 @@ stop() -> | |||
Impl = application:get_env(vmq_server, metadata_impl, vmq_plumtree), | |||
_ = spawn(fun() -> | |||
Ret = vmq_plugin_mgr:disable_plugin(Impl), | |||
lager:info("Try to stop ~p: ~p", [Impl, Ret]) | |||
?LOG_INFO("Try to stop ~p: ~p", [Impl, Ret]) |
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.
?LOG_INFO("Try to stop ~p: ~p", [Impl, Ret]) | |
?LOG_INFO("Trying to stop ~p: ~p", [Impl, Ret]) |
d0c66f8
to
938152b
Compare
currently testing & reviewing. plan to merge this for the upcoming release. |
Address code review Co-authored-by: Dairon M. <dairon.medina@gmail.com>
a5ba7fd
to
bc97838
Compare
* Initial logger support * Apply suggestions from code review Address code review Co-authored-by: Dairon M. <dairon.medina@gmail.com> * Address review comments (log show -> log show config) --------- Co-authored-by: mths1 <mths1> Co-authored-by: Dairon M. <dairon.medina@gmail.com>
Proposed Changes
Work in Progress, but works. Currently only console and error log are supported. Investigating syslog and crash. Help is welcome...
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
Further Comments
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.