Bug 1273817 - "--timestamps" doesn't work for `oc logs`
"--timestamps" doesn't work for `oc logs`
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michail Kargakis
Wei Sun
: UpcomingRelease
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-21 06:13 EDT by Wei Sun
Modified: 2016-01-05 01:09 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:15:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wei Sun 2015-10-21 06:13:25 EDT
Description of problem:
Show the logs with "--timestamps",when "--timestamps=true",the logs show timestamps,like "09:36:42.480007",but when "--timestamps=false",the logs still show timestamps,like "09:36:42.480007"


Version-Release number of selected component (if applicable):
devenv-rhel_2504
# oc version
oc v1.0.6-801-ge74f43a
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

How reproducible:
Always

Steps to Reproduce:
1.oc logs bc/nd --timestamps=false > bc1.log
2.oc logs bc/nd --timestamps=true > bc2.log
3.diff bc1.log bc2.log
4.Check bc1.log and bc2.log

Actual results:
3.bc1.log is same with bc2.log
4.In bc1.log and bc2.log,the logs are like:
I1021 09:35:52.868137       1 sti.go:407] mongodb@2.0.46 node_modules/mongodb
I1021 09:35:52.868141       1 sti.go:407] ├── readable-stream@1.0.31 (inherits@2.0.1, isarray@0.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
I1021 09:35:52.868144       1 sti.go:407] ├── es6-promise@2.1.1
I1021 09:35:52.868148       1 sti.go:407] └── mongodb-core@1.2.19 (bson@0.4.19, kerberos@0.0.15)
E1021 09:35:52.868161       1 util.go:85] npm info ok
I1021 09:36:18.704374       1 sti.go:149] Using provided push secret for pushing 172.30.255.67:5000/wsuntest/nd:latest image
I1021 09:36:18.704988       1 sti.go:151] Pushing 172.30.255.67:5000/wsuntest/nd:latest image ...
I1021 09:36:42.480007       1 sti.go:155] Successfully pushed 172.30.255.67:5000/wsuntest/nd:latest


The timestamps "09:36:42.480007" is shown when "--timestamps=false" 

Expected results:
When "--timestamps=false",the timestamps should be shown 

Additional info:
Comment 1 David Eads 2015-10-22 12:56:39 EDT
I think I'd like to fix this by including the PodLogOptions on the BuildLogOptions.  Be sure to keep `Follow` backwards compatible.

Thanks for picking this up.
Comment 2 Michail Kargakis 2015-10-27 13:44:41 EDT
Will be fixed post 3.1
Comment 3 Michail Kargakis 2015-10-30 12:15:01 EDT
Fixed in latest master
Comment 4 Wei Sun 2015-11-01 21:32:38 EST
Verified in the devenv-rhel7_2619

Result:
1.# oc logs bc/rubytest -n wsuntest --timestamps=false
Already on 'master'
I1102 02:24:06.247261       1 sti.go:448] ---> Installing application source ...
I1102 02:24:06.248976       1 sti.go:448] ---> Building your Ruby application from source ...
I1102 02:24:06.249129       1 sti.go:448] ---> Running 'bundle install ' ...
I1102 02:24:09.095606       1 sti.go:448] Fetching gem metadata from https://rubygems.org/..........
I1102 02:24:09.459085       1 sti.go:448] Resolving dependencies...
I1102 02:24:10.637763       1 sti.go:448] Installing rack (1.6.4) 
I1102 02:24:10.637857       1 sti.go:448] Using bundler (1.3.5) 
I1102 02:24:10.638319       1 sti.go:448] Your bundle is complete!
I1102 02:24:10.638399       1 sti.go:448] It was installed into ./bundle
I1102 02:24:10.653591       1 sti.go:448] ---> Cleaning up unused ruby gems ...
I1102 02:24:16.093908       1 sti.go:221] Using provided push secret for pushing 172.30.125.194:5000/wsuntest/rubytest:latest image
I1102 02:24:16.093934       1 sti.go:225] Pushing 172.30.125.194:5000/wsuntest/rubytest:latest image ...
I1102 02:25:16.835121       1 sti.go:241] Successfully pushed 172.30.125.194:5000/wsuntest/rubytest:latest


2.# oc logs bc/rubytest -n wsuntest --timestamps=true
2015-11-02T02:24:05.889003851Z Already on 'master'
2015-11-02T02:24:06.247700344Z I1102 02:24:06.247261       1 sti.go:448] ---> Installing application source ...
2015-11-02T02:24:06.249087927Z I1102 02:24:06.248976       1 sti.go:448] ---> Building your Ruby application from source ...
2015-11-02T02:24:06.256048311Z I1102 02:24:06.249129       1 sti.go:448] ---> Running 'bundle install ' ...
2015-11-02T02:24:09.095929780Z I1102 02:24:09.095606       1 sti.go:448] Fetching gem metadata from https://rubygems.org/..........
2015-11-02T02:24:09.459337914Z I1102 02:24:09.459085       1 sti.go:448] Resolving dependencies...
2015-11-02T02:24:10.638237439Z I1102 02:24:10.637763       1 sti.go:448] Installing rack (1.6.4) 
2015-11-02T02:24:10.638249744Z I1102 02:24:10.637857       1 sti.go:448] Using bundler (1.3.5) 
2015-11-02T02:24:10.638361386Z I1102 02:24:10.638319       1 sti.go:448] Your bundle is complete!
2015-11-02T02:24:10.638594188Z I1102 02:24:10.638399       1 sti.go:448] It was installed into ./bundle
2015-11-02T02:24:10.653926547Z I1102 02:24:10.653591       1 sti.go:448] ---> Cleaning up unused ruby gems ...
2015-11-02T02:24:16.093984097Z I1102 02:24:16.093908       1 sti.go:221] Using provided push secret for pushing 172.30.125.194:5000/wsuntest/rubytest:latest image
2015-11-02T02:24:16.094193350Z I1102 02:24:16.093934       1 sti.go:225] Pushing 172.30.125.194:5000/wsuntest/rubytest:latest image ...
2015-11-02T02:25:16.837806230Z I1102 02:25:16.835121       1 sti.go:241] Successfully pushed 172.30.125.194:5000/wsuntest/rubytest:latest

Note You need to log in before you can comment on or make changes to this bug.