Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up2.0.0-beta.5 removes `log.format` flag #3219
Comments
brian-brazil
added
priority/Pmaybe
component/config
labels
Sep 28, 2017
This comment has been minimized.
This comment has been minimized.
khardsonhurley
commented
May 7, 2018
|
I am having the same issue with |
This comment has been minimized.
This comment has been minimized.
|
this was removed when the Prometheus started using the go kit logger. @khardsonhurley what is your use case why do you need a different log format? |
This comment has been minimized.
This comment has been minimized.
khardsonhurley
commented
May 8, 2018
|
Nevermind, we just removed it and the startout format works just fine for our use case. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
ok , thanks , closing for now , but feel free to reopen if there is a good use case. |
krasi-georgiev
closed this
May 9, 2018
This comment has been minimized.
This comment has been minimized.
|
Sorry, maybe I'm missing something obvious. Is there a way to log with JSON now? I don't see a flag or a configuration option for changing the logging format. |
This comment has been minimized.
This comment has been minimized.
|
no there isn't , go kit seems to support json formatting so in theory shouldn't be a big problem to add the flag given there are enough use cases that need this. @TimSimmons what is your use case? |
This comment has been minimized.
This comment has been minimized.
|
I'd like to have structured logging in JSON so that the messages can be optimally indexed in Elasticsearch in our centralized logging setup. |
This comment has been minimized.
This comment has been minimized.
|
yep that sound like a good use case :) looking at the example looks like an easy task, just need to use |
krasi-georgiev
reopened this
May 10, 2018
This comment has been minimized.
This comment has been minimized.
|
If nobody's working on this, I'd like to take this up! |
This comment has been minimized.
This comment has been minimized.
|
@alexander-yu yep go ahead. Thanks. I will review when ready. |
alexander-yu
added a commit
to alexander-yu/common
that referenced
this issue
May 22, 2018
alexander-yu
added a commit
to alexander-yu/common
that referenced
this issue
May 22, 2018
alexander-yu
added a commit
to alexander-yu/common
that referenced
this issue
May 22, 2018
alexander-yu
added a commit
to alexander-yu/common
that referenced
this issue
May 22, 2018
This comment has been minimized.
This comment has been minimized.
ntindall
commented
Jun 26, 2018
|
Ping on this - would love to see this happen @alexander-yu |
This comment has been minimized.
This comment has been minimized.
|
Sure thing; promlog needs to be modified first to get support for using JSON loggers. I've got a PR waiting on prometheus/common (see above) that'll provide the necessary methods for configuring the logger type. |
This comment has been minimized.
This comment has been minimized.
ntindall
commented
Jun 26, 2018
|
Nice |
TimSimmons commentedSep 25, 2017
What did you do?
Upgraded from
beta.3tobeta.5What did you expect to see?
The
--log.formatflag continuing to exist.What did you see instead? Under which circumstances?
prometheus: error: unknown long flag '--log.format'Environment
Additional Context
I was using
--log.format="logger:syslog?appname=prometheus&local=7&json=true". If there's another way to do that in 2.0 that'll be preferred I'm happy to change. I suppose it could also be done with process supervisors or something. However, I would expect people upgrading from 1.x will be used to this flag/format and will have something that works for them.