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

Request: gcplogs driver (and others) should support log level severity #22736

Closed
hamx0r opened this Issue May 14, 2016 · 7 comments

Comments

Projects
None yet
7 participants
@hamx0r
Copy link

hamx0r commented May 14, 2016

In the vein of #18480, any of the log drivers could accept a regular expression string as an argument to configure the driver to parse the log body (ie stdout) so that additional fields could be set for whatever log driver is bing used. For Google Stackdriver Logging (aka Google Cloud Logging), the driver sets a data field which contains the full text of the log entry as a single string. I suggest any of the following improvements:

  1. Use the stream to establish a Severity level: stdout means info, and stderr means error. Even just 2 log levels would be a big help.
  2. A regex string --log-opt could be used to set more structured data here which would end up in the structPayload part of the log message in Google Stackdriver Logging, making it filterable.
  3. Similarly, a regexp string could break a log message into existing fields, like severity

Both regex ideas could be implemented using named groups.

@henryw374

This comment has been minimized.

Copy link

henryw374 commented Jan 4, 2017

a possible alternative it to tell gcplogs to parse log messages as json. then users can use a logging encoder to record timestamp, severity fields etc as required by google cloud logging.

@cpuguy83

This comment has been minimized.

Copy link
Contributor

cpuguy83 commented Jan 4, 2017

Definitely -1 to applying a regex to each log message.

@thaJeztah

This comment has been minimized.

Copy link
Member

thaJeztah commented Jan 4, 2017

Agreed, applying a regex to each log message is going to seriously affect logging performance, which will be an issue for high-volume logging. Performing the same search on Google's side may be an alternative (also I realize that's not ideal as well) https://cloud.google.com/logging/docs/view/advanced_filters

I don't think we should implement this in the core functionality of docker. Note that work is being done on supporting external logging driver plugins. Once that's there, custom logging driver plugins can implement this, so that people that need this functionality, and know the implications, can install a custom driver; #28403

Some alternative proposals that don't involve regexing each message can be found here; #29604, and #25683, and possibly could allow adding more flexibility

I'm closing this issue because we won't implement this as suggested, but feel free to comment after I closed.

@thaJeztah thaJeztah closed this Jan 4, 2017

@henryw374

This comment has been minimized.

Copy link

henryw374 commented Jan 4, 2017

More of what I'm suggesting then, have a way to stop the gcplog plugin wrapping the message as {"data" : }, ie --raw or some such, so users can log in json format and so set the correct severity etc.

@c0b

This comment has been minimized.

Copy link
Contributor

c0b commented Oct 20, 2017

so what's the best solution to have gcplogs severity levels so far?

@nikhilk

This comment has been minimized.

Copy link

nikhilk commented Jul 11, 2018

Anyone know if whether is there an alternate gcp log driver that supports some customization?

@ernsheong

This comment has been minimized.

Copy link

ernsheong commented Dec 22, 2018

What is the correct way to get severity-colored information to be correctly reflected in the GCP Logging console?

Like this:
image

This seems like an important use case, appreciate any efforts toward this aim.

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.