https://pulp.plan.io/https://pulp.plan.io/favicon.ico2016-12-10T22:49:18ZPulpPulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=164012016-12-10T22:49:18Zbmbouterbmbouter@redhat.com
<ul></ul><p>It would make the logs statements long, but we should have every Pulp log statement running inside a task did include the Task id. Pids are not as useful because the task id currently logged is the parent's pid and the rest of the log messages are the child's different pid. Also having task ids would be better for clustered installs where pids could collide. We could figure out how to implement this I think.</p>
<p>Regarding the pid's, if we did that we would publish a syslog config which would include the pids. But we should just add the task ids.</p>
<p>Instead of <code>Dec 10 19:56:55 dev pulp[32137]: requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): repos.fedorapeople.org</code></p>
<p>It could be: <code>Dec 10 19:56:55 dev pulp[32137]: requests.packages.urllib3.connectionpool:INFO: [0ca4399c-51eb-47c8-9a07-145e61e389a5] Starting new HTTPS connection (1): repos.fedorapeople.org</code></p>
<p>Or it could be: <code>Dec 10 19:56:55 dev pulp[32137]: [0ca4399c-51eb-47c8-9a07-145e61e389a5] requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): repos.fedorapeople.org</code></p>
<p>I prefer the former I think so that all log statements have the position of the python package and log level in the same place when running inside or outside of a task. Log statements running outside of tasks will not get the UUID.</p>
<p>What do others think?</p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=168542017-01-10T22:23:39Zsemyerssean.myers@redhat.com
<ul><li><strong>Groomed</strong> changed from <i>No</i> to <i>Yes</i></li><li><strong>Sprint Candidate</strong> changed from <i>No</i> to <i>Yes</i></li></ul><p>I consider the groomed, provided we take one of Brian's suggested solutions in comment 1 (pids aren't so useful in log messages, but task IDs are very useful).</p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=168992017-01-13T18:24:21Zmhrivnakmhrivnak@redhat.com
<ul></ul><p>Just an idea: what about only logging the first 8 characters of the task ID? That should be plenty of uniqueness to avoid collision while providing a good reference.</p>
<pre><code>Dec 10 19:56:55 dev pulp[32137]: requests.packages.urllib3.connectionpool:INFO: [0ca4399c-51eb-47c8-9a07-145e61e389a5] Starting new HTTPS connection (1):
</code></pre>
<p>vs</p>
<pre><code>Dec 10 19:56:55 dev pulp[32137]: requests.packages.urllib3.connectionpool:INFO: [0ca4399c] Starting new HTTPS connection (1):
</code></pre> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169132017-01-13T20:06:25Zbmbouterbmbouter@redhat.com
<ul></ul><p><a class="user active" href="https://pulp.plan.io/users/7">mhrivnak</a> +1 to that idea. Retaining 8 characters will still keep collision probabilities low. 1 in 36^8 = 2,821,109,907,456 by my count.</p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169142017-01-13T20:13:41Zbmbouterbmbouter@redhat.com
<ul></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169162017-01-13T20:47:03Zbmbouterbmbouter@redhat.com
<ul><li><strong>Subject</strong> changed from <i>As a user, I can correlate log statements to a task ID</i> to <i>As a user, I can see the first 8 characters of a task id in every log statement emitted from a running task</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169172017-01-13T20:52:46Zbmbouterbmbouter@redhat.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/16917/diff?detail_id=17677">diff</a>)</li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169182017-01-13T20:57:05Zmhrivnakmhrivnak@redhat.com
<ul><li><strong>Sprint/Milestone</strong> set to <i>31</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=169222017-01-16T14:05:51Zmhrivnakmhrivnak@redhat.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>31</i> to <i>32</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=170092017-01-17T20:52:22Zdaviddavis
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>daviddavis</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=170862017-01-19T21:24:37Zdaviddavis
<ul></ul><p>My initial thought (and please tell me if this is a bad idea) was to write a Filter to set a task id on the LogRecord and then have the logger output that using a custom Formatter. However, that would require some global way to be able to get the task id but I didn't see any code for doing that. Is there a way to do that?</p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=170872017-01-19T21:37:46Zbmbouterbmbouter@redhat.com
<ul></ul><p>Here is a global way to get the task id [0]. I can't speak to the implementation approach, but whatever it does it needs to work well with our existing logger [1].</p>
<p>[0]: <a href="https://github.com/bmbouter/pulp/blob/f9355d21559fa880fd7654134d8f34dcf6b85acf/server/pulp/server/async/tasks.py#L643-L643" class="external">https://github.com/bmbouter/pulp/blob/f9355d21559fa880fd7654134d8f34dcf6b85acf/server/pulp/server/async/tasks.py#L643-L643</a><br>
[1]: <a href="https://github.com/pulp/pulp/blob/master/server/pulp/server/logs.py" class="external">https://github.com/pulp/pulp/blob/master/server/pulp/server/logs.py</a></p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=171042017-01-22T22:27:56Zdaviddavis
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p><a href="https://github.com/pulp/pulp/pull/2924" class="external">https://github.com/pulp/pulp/pull/2924</a></p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=171372017-01-24T20:24:45Zdaviddavis
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="Appending 8 character task id to log output Appending a 8 character task id to log output if the..." href="https://pulp.plan.io/projects/pulp/repository/pulp/revisions/431b5d2c832ad50c33daccb3f852be31583a4b9c">pulp|431b5d2c832ad50c33daccb3f852be31583a4b9c</a>.</p> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=183372017-03-06T16:20:36Zsemyerssean.myers@redhat.com
<ul><li><strong>Platform Release</strong> set to <i>2.13.0</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=191902017-04-17T13:17:39Zpcreechpcreech@redhat.com
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>5</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=193502017-04-27T13:43:20Zpcreechpcreech@redhat.com
<ul><li><strong>Status</strong> changed from <i>5</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=257162018-03-08T22:11:21Zbmbouterbmbouter@redhat.com
<ul><li><strong>Sprint</strong> set to <i>Sprint 16</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=257332018-03-08T22:11:52Zbmbouterbmbouter@redhat.com
<ul><li><strong>Sprint</strong> changed from <i>Sprint 16</i> to <i>Sprint 14</i></li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=257542018-03-08T22:12:17Zbmbouterbmbouter@redhat.com
<ul><li><strong>Sprint/Milestone</strong> deleted (<del><i>32</i></del>)</li></ul> Pulp - Story #2324: As a user, I can see the first 8 characters of a task id in every log statement emitted from a running taskhttps://pulp.plan.io/issues/2324?journal_id=386092019-04-15T20:24:19Zbmbouterbmbouter@redhat.com
<ul><li><strong>Tags</strong> <i>Pulp 2</i> added</li></ul>