-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
build: loglevel=2 and loglevel=1 messages not getting logged (WAS: cluster up: builds do not get loglevel=2 by default) #9247
Comments
@bparees - so I found the difference is not 'cluster up', rather this pull: #8924 Bottom line is that glog.V(>0) messages will no longer show up in the log by default. Which I think is the more correct behavior, since if you look at the build pod, it's getting passed a --loglevel=0 and prior to #8924 we were ignoring that. |
hm, then we may need to revisit what's being logged at level "1" because a lot of those messages should always be seen. |
For now we will change anything logged at level 1 or 2 to "0". Does that sound acceptable? |
@csrwng it sounds like the right starting point for the PR. we can review what messages that ends up including in the PR. |
Reopening this, see my comments in the PR but this undid the very careful work to hide a bunch of info that is not useful for most users. Regular users of the platform don't need this info unless they ask for it. |
Here's some rules of thumb for how to be a good logging agent that should define the foundation of what the builders should be logging
For builds specifically, if you took a brand new programmer off the street (someone using node.js for less than a month) and you made them look at the log output, they shouldn't see anything they couldn't figure out as being related to what their goal is Also, we have rules about what log goes at what levels (see the upstream kubernetes docs/devel/logging.md file).
Some stuff that got added back in and some reasons why it's bad:
Not useful for end users. Should be v(4).
It's great to say we're going to be pulling.... but most of the info there is meaningless to a normal user. The digest in particular is very problematic - it takes up 80 characters and will cause wrapping in most cases, yet conveys no real info. We might make an exception to show it in this case because then a user could go back and use it... but a user isn't actually going to be able to recreate the build locally, so the full digest only belongs at v(3) or above. At V(1), what info do we actually need to convey?
No.
Saying the same thing two different ways. The first one is better. The second one is redundant and should not be printed at v2.
This is just something that snuck in, but shouldn't be logged here. V(4), maybe V(3).
This is kind of useful, but unfortunately is not actionable by a user. How does knowing this help me to verify my build succeeded or failed? |
Bumping the priority of this up to p1 - I'm trying to record a screencast for summit that is demonstrating how awesome and succinct we are from cluster up all the way to the UI, and so I need this fixed by Monday afternoon, because we aren't. |
Also, the warning message we print about mismatched versions is not actionable by any user of the platform, and is just a debugging message for OpenShift developers. It should be at v(3). No one will ever be able to do anything about it who isn't a cluster admin. |
they can't do anything about it, but when they send us their "my build isn't working, here's the output" log, it's nice that we can immediately see that warning without having to go back to them and get more verbose logging. Warnings aren't necessarily for users to fix, they are for users to be aware that "something isn't right" and perhaps to consult their admin or support. Afterall, that is not a message any normal users should be seeing if they've got a proper install. |
Who is that? OpenShift Online users? When is this ever going to be actioned? Why does the exact commit matter? What if we release a new version of the master, but don't rev the sti-builder (which is what happens all the time)? It might be useful rarely. It's not useful enough that it's worth clogging up user output with. It's also spurious the majority of the time it's shown. If you can reduce the false-positive rate significantly, I might agree it's worth keeping. |
we don't do releases w/o doing that, do we? So any OSE or origin release user should have matching levels. And online should also have matching levels. I would only expect this to be showing up for people doing active openshift development, if it's showing up for users who did a proper install of a packaged release then i agree, something has gone wrong and it needs to be revisited. |
OSE does not rev sit-builder in all cases. Origin does not rev sti-builder in all cases. |
loglevel 3 it is, then. |
Another alternative on a build error is to always print that if it's true - i.e. at the very end. |
I kind of regret --build-loglevel now - users having to select a level is very unintuitive. I think we probably want to have a --verbose flag instead and set the level ourselves (to 3 or 4 or similar). |
@smarterclayton @bparees Hopefully these two PRs cover what is required for Monday's screencast. |
Can you paste the output in one of the PRs so we can look? |
Sorry about the delay on the logs. I'm not able to get a clone of the current source-to-image repo running in my development environment. Will work with Ben. |
s2i test was blocked briefly by openshift/source-to-image#520 . @bparees was able to get me going again. PR openshift/source-to-image#519 has now been accepted. Now working on integrating this into my openshift/origin dev environment. |
Output at all log levels with new s2i and logging tweaks: https://gist.github.com/jupierce/303fa169792c2a646976d3ff097f4be8 Noticing a few printf %!q(MISSING) entries. |
the MISSING items appear to be a bug in @smarterclayton's glog wrapping logic, because i don't see anything else wrong with: and
|
There should be no glog prefixes at v1 or v2... |
Means some code is not using the right package and is logging its own errors (instead of returning errors). |
What is this?
Should have no glog prefix.
This is not a message a user cares about.
What is this? Not useful at 2.
|
@smarterclayton most of s2i is still using glog, you only changed the docker package w/ your wrapper pr. |
Ok. So something else that needs to get fixed. |
@jupierce can you please update the rest of s2i to use the utilglog wrapper as seen here: |
Sure thing. |
s2i to use utilglog in openshift/source-to-image#524 |
Integrated fix for Missing Infof parameters into PR #9428 . The utilglog package is duplicated in source-to-image and origin (I fixed the problem in both places). Would be make sense to make this a Godep? |
probably not, we'd either have to either:
so while duplicating it also kinda sucks, for now i think we're going to stick with that. |
SGTM, least bad of all options. On Thu, Jun 23, 2016 at 5:30 PM, Ben Parees [email protected]
|
why not pass in a logger in the s2i config? If no logger is passed then s2i can use a default one that's just a glog passthrough? We also need s2i to display the same image pull progress that we have in origin. I don't think the solution is to copy the image progress class to s2i as well. I'd rather pass a writer in the config to use for the pull call. |
not sure what problem you're trying to solve. we want passthrough behavior in both openshift and s2i. s2i has to be able to run w/o openshift present, so passing something from openshift to s2i doesn't help. Same for the pull progress implementation. |
Repeat for image progress. |
Why do we want the logging behavior to be the same in s2i standalone as when it's called from origin? It's a different use case. |
For example, image progress for standalone s2i can be the default docker progress because most likely it's going to be output to a terminal, and it's not necessarily a bad experience. |
we can discuss that for a followup. right now this p1 has been open for a week and it's easily solved by updating the existing s2i code to use the existing s2i log wrapper implementation with the correct log levels, so i'd like to get that landed before we start re-architecting things. @smarterclayton is talking about ripping glog out entirely anyway, so this isn't the right place to try to invent the future of our logging structure. |
@jupierce i've lost track. all the s2i and origin changes to make us log basic useful stuff at level 0 are now merged/bumped/etc? |
@bparees Yes. Just wasn't sure if this has satisfied all parties concerned. |
i'm satisfied :) |
Only glog.V(0).Info messages are printed out when running a build in a cluster that has been started by 'oc cluster up'. The default should be loglevel 2.
Version
v1.3.0-alpha.1-190
Steps To Reproduce
Start a new cluster with 'oc cluster up'
Start a new build 'oc new-app https://github.com/openshift/ruby-hello-world.git'
Examine build logs
Current Result
glog.V(1) messages from builder are not printed out
Expected Result
glog.V(1) and glog.V(2) messages are printed out
The text was updated successfully, but these errors were encountered: