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

Add full command to extras #352

Merged
merged 1 commit into from Apr 12, 2021
Merged

Add full command to extras #352

merged 1 commit into from Apr 12, 2021

Conversation

ostrolucky
Copy link
Contributor

Fixes #351

Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

As said in the related issue, it can't be implemented like this, as a default behavior.

@Jean85 Jean85 added this to the 3.5 milestone Jun 29, 2020
@Jean85 Jean85 modified the milestones: 3.5, 4.0 Jul 8, 2020
@Jean85
Copy link
Collaborator

Jean85 commented Jan 11, 2021

@ste93cry do you think we should recover this into the 4.0 release? Take a look at the discussion in #351 too.

@ste93cry
Copy link
Collaborator

I'm generally favourable to adding logging of the command. Regarding the sanitization, As it's a full string I don't think that Sentry can hide or detect specific portions of it so that values of certain command arguments or options will be hidden... I wonder anyway why someone would pass sensitive data as an argument or option, since it would be visible in the CLI as much as in any log system. Bonus question: I'm really doubtful about whether the command should be logged in the extra context or as a breadcrumb

@ostrolucky
Copy link
Contributor Author

According link in linked issue, laravel also passes whole thing as string, so I don't believe this is an issue.

As for breadcrumbs, in my pov breadcrumbs are something which happens in sequence, like a log. I think command name does not quite fit in that definition, similarly like request url and so on. Especially when command name already is a tag instead of bread crumb and I'm implementing now just logging of full command name - but I deemed full command name being too unique for being a tag, hence second best was extra.

@ste93cry
Copy link
Collaborator

As for breadcrumbs, in my pov breadcrumbs are something which happens in sequence, like a log. I think command name does not quite fit in that definition, similarly like request url and so on

True, but in Symfony the concept of subrequest exists as it exists the concept of a command started and running within another. I would say that logging as bredcrumbs both the start of a request and of a command would be useful. Anyway, I agree that at the moment logging the full command in the extras is enough

I deemed full command name being too unique for being a tag

Absolutely agree with this claim

src/EventListener/ConsoleCommandListener.php Outdated Show resolved Hide resolved
src/EventListener/ConsoleCommandListener.php Outdated Show resolved Hide resolved
tests/End2End/End2EndTest.php Show resolved Hide resolved
Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 but please add a changelog entry

@ste93cry ste93cry modified the milestones: 4.0, 4.1 Apr 10, 2021
@ste93cry ste93cry changed the base branch from master to develop April 10, 2021 17:31
@Jean85
Copy link
Collaborator

Jean85 commented Apr 12, 2021

Build should be fixed by #480, but there are conflicts now.

@ostrolucky
Copy link
Contributor Author

rebased

@Jean85 Jean85 merged commit d3833ab into getsentry:develop Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture command arguments
3 participants