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

Log a job ID for cli commands #12717

Merged
merged 5 commits into from Apr 12, 2018
Merged

Log a job ID for cli commands #12717

merged 5 commits into from Apr 12, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 12, 2018

looks like this where 60d1f is the job ID in this case. We could also wrap it in brackets or something.

image

I'm not sure why this was disabled in the past for cli commands. I'm finding this super useful when investigating issues. For example imagine 2 or more core:archive > archive.log are running at the same time. Now both jobs will be writing into that log and it is not clear which action is performed by which process. The requestId lets you grep information only for a specific job for example and see when there were for example any possible concurrency issues etc.

@tsteur tsteur added the Needs Review PRs that need a code review label Apr 12, 2018
@tsteur tsteur added this to the 3.5.0 milestone Apr 12, 2018
@tsteur tsteur requested a review from mattab April 12, 2018 00:06
Copy link
Member

@diosmosis diosmosis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was to remove the request ID for normal CLI commands that might have logs, but don't think it would really add to the clutter.

@mattab
Copy link
Member

mattab commented Apr 12, 2018

instead of substr(Common::generateUniqId(), 0, 5); maybe we could use the current pid of the process? this way it could be grep'able if process is still running?

Fyi: a test or two in the build would need to be fixed

@diosmosis
Copy link
Member

Piwik\Plugins\Monolog\tests\Integration\LogTest is failing now, otherwise good to merge

@tsteur
Copy link
Member Author

tsteur commented Apr 12, 2018

Fixed the test

@diosmosis diosmosis merged commit 6b42db9 into 3.x-dev Apr 12, 2018
@diosmosis diosmosis deleted the logclirequestid branch April 12, 2018 04:27
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
* log requestId for cli commands

* format console log

* log pid for cli commands

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants