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

2.0.0-beta.5 removes `log.format` flag #3219

Closed
TimSimmons opened this Issue Sep 25, 2017 · 13 comments

Comments

Projects
None yet
6 participants
@TimSimmons
Copy link

TimSimmons commented Sep 25, 2017

What did you do?

Upgraded from beta.3 to beta.5

What did you expect to see?

The --log.format flag continuing to exist.

What did you see instead? Under which circumstances?

prometheus: error: unknown long flag '--log.format'

Environment

  • Prometheus version:
$ ./bin/prometheus --version
prometheus, version 2.0.0-beta.5 (branch: HEAD, revision: 64c7932e851f3276391fc3e216cd30f447d4924e)
  build user:       root@df40cc0bd79b
  build date:       20170921-16:23:04
  go version:       go1.8.3

Additional Context

#promtheus
11:10 T<timsim> Were the changes from beta.4 to beta.5 supposed to remove the `--log.format` flag? https://github.com/prometheus/prometheus/pull/3152 It appears they have
11:11 G<gouthamve[m]> Yes. We were initially going to see if people really need another format and slowly add it back I guess
11:11 G<gouthamve[m]> Can you create an issue?

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.

@khardsonhurley

This comment has been minimized.

Copy link

khardsonhurley commented May 7, 2018

I am having the same issue with --log.format on version 2.0.0 and was wondering if this issue has been addressed?

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 8, 2018

this was removed when the Prometheus started using the go kit logger.
I had a quick look and it seems that go kit also support the json format.

@khardsonhurley what is your use case why do you need a different log format?

@khardsonhurley

This comment has been minimized.

Copy link

khardsonhurley commented May 8, 2018

Nevermind, we just removed it and the startout format works just fine for our use case. Thanks!

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 9, 2018

ok , thanks , closing for now , but feel free to reopen if there is a good use case.

@TimSimmons

This comment has been minimized.

Copy link
Author

TimSimmons commented May 10, 2018

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.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 10, 2018

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?

@TimSimmons

This comment has been minimized.

Copy link
Author

TimSimmons commented May 10, 2018

I'd like to have structured logging in JSON so that the messages can be optimally indexed in Elasticsearch in our centralized logging setup.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 10, 2018

yep that sound like a good use case :)
I hope you have some time to open a PR 👍

looking at the example looks like an easy task, just need to use NewJSONLogger
https://github.com/go-kit/kit/tree/master/log

@alexander-yu

This comment has been minimized.

Copy link
Contributor

alexander-yu commented May 20, 2018

If nobody's working on this, I'd like to take this up!

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 21, 2018

@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

promlog: add support for json logger
Note: this changes the signature of promlog.New, so any repos
that use this method in prometheus will need to be changed and
will need to include the `log.format` flag.

Fixes issue: prometheus/prometheus#3219

alexander-yu added a commit to alexander-yu/common that referenced this issue May 22, 2018

promlog: add support for json logger
Note: this changes the signature of promlog.New, so any repos
that use this method in prometheus will need to be changed and
will need to include the `log.format` flag.

Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

alexander-yu added a commit to alexander-yu/common that referenced this issue May 22, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

alexander-yu added a commit to alexander-yu/common that referenced this issue May 22, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>
@ntindall

This comment has been minimized.

Copy link

ntindall commented Jun 26, 2018

Ping on this - would love to see this happen @alexander-yu

@alexander-yu

This comment has been minimized.

Copy link
Contributor

alexander-yu commented Jun 26, 2018

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.

@ntindall

This comment has been minimized.

Copy link

ntindall commented Jun 26, 2018

Nice 👍

alexander-yu added a commit to alexander-yu/common that referenced this issue Sep 6, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

alexander-yu added a commit to alexander-yu/common that referenced this issue Sep 13, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

alexander-yu added a commit to alexander-yu/common that referenced this issue Sep 13, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

alexander-yu added a commit to alexander-yu/common that referenced this issue Sep 13, 2018

promlog: add support for json logger
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>

brian-brazil added a commit to prometheus/common that referenced this issue Nov 13, 2018

promlog: add support for json logger (#136)
Fixes issue: prometheus/prometheus#3219

Signed-off-by: Alex Yu <yu.alex96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.