Project

Profile

Help

Story #145

closed

As a pulp-admin user, I would like logs to go to stderr

Added by cduryee almost 10 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
2.7.0
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
February 2015
Quarter:

Description

Recapping some of the ideas:

RCM typically uses the Pulp API for tasks, but occasionally needs to run multiple pulp-admin commands in parallel. Currently this is impossible due to the way pulp-admin works.

  • stop pulp-admin from writing out logs to files
  • Update all user facing strings that tell them to NOT go look at the logs
  • all logging should go to the stderr
  • Add a -v option that turns on logging to INFO
  • Add a -vv option that turns on logging to DEBUG
  • update the docs with this new loggin' behavior
  • Make sure there is a release note on this.
  • Any new code introduced needs to have 100% test coverage.

Related issues

Has duplicate Pulp - Story #286: Pulp clients should not log to filesCLOSED - DUPLICATEskarmark@redhat.com

Actions
Actions #1

Updated by rbarlow almost 10 years ago

I think this may be a duplicate with #1175820[0]. That bug has a different take on it, which is that clients just shouldn't do logging. I think we should offer -v and -vv flags instead, where -v prints to stdout what currently goes to admin.log, and -vv prints what currently goes to server_calls.log.

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1175820

Actions #2

Updated by mhrivnak almost 10 years ago

  • Priority changed from Normal to High
Actions #3

Updated by cduryee almost 10 years ago

I like the -v and -vv idea better, but can that be done in a 2.y release?

Actions #4

Updated by bcourt almost 10 years ago

Seems like if we add the -v and -w and we only disable the logs if one of them is selected we would be ok. We could then deprecate the usage of the log files towards removing them in 3.0. The -w is going to be really chatty for publishes.

Actions #5

Updated by rbarlow almost 10 years ago

  • Tags Sprint Candidate added
Actions #6

Updated by rbarlow almost 10 years ago

On 02/06/2015 03:05 PM, Chris Duryee wrote:

I like the -v and -vv idea better, but can that be done in a 2.y release?

That's a good question. I personally feel like it's a little fuzzy since
it does actually cause multi-process issues. Also, it is doubtful
(though not impossible) that people are actually doing integration that
depends on these log files existing.

Due to the fact that doing it the way we are doing it breaks
multi-process, and due to it being unlikely that anyone depends on this
behavior, I would vote that it is OK to change with a 2.Y.

However, if others feel strongly, I would be cool with waiting for the
3.0 release too.

Actions #7

Updated by bmbouter almost 10 years ago

Recapping some of the ideas:

RCM typically uses the Pulp API for tasks, but occasionally needs to run multiple pulp-admin commands in parallel. Currently this is impossible due to the way pulp-admin works.

  • stop pulp-admin from writing out logs to files
  • Update all user facing strings that tell them to NOT go look at the logs
  • all logging should go to the stderr
  • Add a -v option that turns on logging to INFO
  • Add a -vv option that turns on logging to DEBUG
  • update the docs with this new loggin' behavior
  • Make sure there is a release note on this.
Actions #8

Updated by bmbouter almost 10 years ago

  • Description updated (diff)
Actions #9

Updated by rbarlow almost 10 years ago

  • Subject changed from As a pulp-admin user, I would like to disable logging to As a pulp-admin user, I would like logs to go to stderr
Actions #10

Updated by bmbouter almost 10 years ago

  • Description updated (diff)
Actions #12

Updated by mhrivnak almost 10 years ago

  • Sprint/Milestone set to 12
Actions #13

Updated by skarmark@redhat.com almost 10 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to skarmark@redhat.com
Actions #14

Updated by skarmark@redhat.com almost 10 years ago

  • % Done changed from 0 to 60
Actions #15

Updated by skarmark@redhat.com almost 10 years ago

Which release should this go into?

Actions #16

Updated by cduryee almost 10 years ago

Personally I'd be +1 for this feature going to master, which would likely be 2.7.

Does anyone want it in 2.6.1?

Actions #17

Updated by bmbouter almost 10 years ago

+1 for putting this onto master. Even though it can be considered bugfix I think the fix will be so different from what is done today that master would be the best.

Actions #18

Updated by skarmark@redhat.com almost 10 years ago

  • Platform Release set to master
Actions #19

Updated by skarmark@redhat.com almost 10 years ago

  • % Done changed from 60 to 80

Just noticed that the story title mentions 'pulp-admin' user. This will also be applicable for pulp-consumer since the client launcher where we add -v and -vv options is in the client-libs package which is common between admin and consumer clients. I don't foresee any issues with that but just wanted to add to the notes that this will get rid of the consumer log file as well.

Actions #20

Updated by rbarlow almost 10 years ago

On 02/17/2015 07:21 PM, Sayli Karmarkar wrote:

Just noticed that the story title mentions 'pulp-admin' user. This will
also be applicable for pulp-consumer since the client launcher where we
add -v and -vv options is in the client-libs package which is common
between admin and consumer clients. I don't foresee any issues with that
but just wanted to add to the notes that this will get rid of the
consumer log file as well.

Even better, in my opinion!

Actions #21

Updated by bmbouter over 9 years ago

  • Tags deleted (Sprint Candidate)
Actions #22

Updated by skarmark@redhat.com over 9 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 80 to 100
Actions #23

Updated by bmbouter over 9 years ago

  • Has duplicate Story #286: Pulp clients should not log to files added
Actions #24

Updated by rbarlow over 9 years ago

  • Platform Release changed from master to 2.7.0
Actions #25

Updated by dkliban@redhat.com over 9 years ago

  • Status changed from MODIFIED to 5
Actions #26

Updated by dkliban@redhat.com over 9 years ago

  • Groomed set to No
  • Sprint Candidate set to No

As result of this story a user of pulp-admin should be able to use -v and -vv flags.

No flag should only output regular output of a command. -v should print INFO, WARNING, and ERROR statements in addition to regular output of pulp-admin command. -vv should show INFO, WARNING, ERROR and DEBUG statements.

Actions #27

Updated by pthomas@redhat.com over 9 years ago

fails-qa

looks like -v does not display INFO

[root@mgmt4 ~]# 
[root@mgmt4 ~]# pulp-admin -v rpm repo sync run  --repo-id zoo
+----------------------------------------------------------------------+
                     Synchronizing Repository [zoo]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[\]
... completed

Downloading repository content...
[==================================================] 100%
RPMs:       0/0 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

Importing errata...
[-]
... completed

Importing package groups/categories...
[-]
... completed

Task Succeeded

[root@mgmt4 ~]# pulp-admin -v rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  synergism
Display Name:        synergism
Description:         None
Content Unit Counts: 

Id:                  test1
Display Name:        test1
Description:         None
Content Unit Counts: 

Id:                  test
Display Name:        test
Description:         None
Content Unit Counts: 
  Package Category: 1
  Package Group:    2
  Rpm:              30

Id:                  rhel6.3-production
Display Name:        rhel6.3-production
Description:         None
Content Unit Counts: 

Id:                  basic-auth
Display Name:        basic-auth
Description:         None
Content Unit Counts: 
  Rpm: 2

Id:                  zoo
Display Name:        zoo
Description:         None
Content Unit Counts: 
  Erratum:          4
  Package Category: 1
  Package Group:    2
  Rpm:              32

[root@mgmt4 ~]# pulp-admin -vv rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

2015-07-20 13:44:10,562 - DEBUG - sending GET request to /pulp/api/v2/repositories/
2015-07-20 13:44:10,685 - INFO - GET request to /pulp/api/v2/repositories/ with parameters None
2015-07-20 13:44:10,686 - INFO - Response status : 200 

2015-07-20 13:44:10,687 - INFO - Response body :
 [
  {
    "display_name": "synergism", 
    "description": null, 
    "last_unit_added": null, 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {}, 
    "_ns": "repos", 
    "_id": {
      "$oid": "559c0906fefb7a1bc12ac50f"
    }, 
    "id": "synergism", 
    "_href": "/pulp/api/v2/repositories/synergism/"
  }, 
  {
    "display_name": "test1", 
    "description": null, 
    "last_unit_added": null, 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {}, 
    "_ns": "repos", 
    "_id": {
      "$oid": "559c0ef5fefb7a1bc3ce969f"
    }, 
    "id": "test1", 
    "_href": "/pulp/api/v2/repositories/test1/"
  }, 
  {
    "display_name": "test", 
    "description": null, 
    "_ns": "repos", 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {
      "package_group": 2, 
      "package_category": 1, 
      "rpm": 30
    }, 
    "last_unit_added": "2015-07-09T13:11:54Z", 
    "_id": {
      "$oid": "559c191ffefb7a1bc12ac51f"
    }, 
    "id": "test", 
    "_href": "/pulp/api/v2/repositories/test/"
  }, 
  {
    "display_name": "rhel6.3-production", 
    "description": null, 
    "last_unit_added": null, 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {}, 
    "_ns": "repos", 
    "_id": {
      "$oid": "559fafeafefb7a1b29c60b46"
    }, 
    "id": "rhel6.3-production", 
    "_href": "/pulp/api/v2/repositories/rhel6.3-production/"
  }, 
  {
    "display_name": "basic-auth", 
    "description": null, 
    "_ns": "repos", 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {
      "rpm": 2
    }, 
    "last_unit_added": "2015-07-14T13:19:08Z", 
    "_id": {
      "$oid": "55a50736fefb7a37ba3a01d0"
    }, 
    "id": "basic-auth", 
    "_href": "/pulp/api/v2/repositories/basic-auth/"
  }, 
  {
    "display_name": "zoo", 
    "description": null, 
    "_ns": "repos", 
    "notes": {
      "_repo-type": "rpm-repo"
    }, 
    "last_unit_removed": null, 
    "content_unit_counts": {
      "package_group": 2, 
      "package_category": 1, 
      "rpm": 32, 
      "erratum": 4
    }, 
    "last_unit_added": "2015-07-20T17:23:00Z", 
    "_id": {
      "$oid": "55a52efafefb7a37bb6ea3a0"
    }, 
    "id": "zoo", 
    "_href": "/pulp/api/v2/repositories/zoo/"
  }
]

Id:                  synergism
Display Name:        synergism
Description:         None
Content Unit Counts: 

Id:                  test1
Display Name:        test1
Description:         None
Content Unit Counts: 

Id:                  test
Display Name:        test
Description:         None
Content Unit Counts: 
  Package Category: 1
  Package Group:    2
  Rpm:              30

Id:                  rhel6.3-production
Display Name:        rhel6.3-production
Description:         None
Content Unit Counts: 

Id:                  basic-auth
Display Name:        basic-auth
Description:         None
Content Unit Counts: 
  Rpm: 2

Id:                  zoo
Display Name:        zoo
Description:         None
Content Unit Counts: 
  Erratum:          4
  Package Category: 1
  Package Group:    2
  Rpm:              32
Actions #28

Updated by pthomas@redhat.com over 9 years ago

  • Status changed from 5 to ASSIGNED
Actions #29

Updated by dkliban@redhat.com about 9 years ago

  • Status changed from ASSIGNED to NEW
  • Assignee deleted (skarmark@redhat.com)
Actions #30

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
Actions #31

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from ASSIGNED to POST
Actions #32

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from POST to 5

We closed https://github.com/pulp/pulp/pull/2074 because this is expected behavior. The reasons are explained in this conversation: https://github.com/pulp/pulp/pull/1698#issuecomment-77535323

tldr: -v will log info level statements only if there are failures.

Actions #33

Updated by rbarlow almost 9 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #34

Updated by bmbouter over 6 years ago

  • Sprint set to February 2015
Actions #35

Updated by bmbouter over 6 years ago

  • Sprint/Milestone deleted (12)
Actions #36

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF