Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cookbook article on how to add exceptions logging in console commands#1965

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 6 commits intosymfony:2.0fromkostiklv:console-logging
Dec 24, 2012

Conversation

kostiklv
Copy link
Contributor

Initially I though about sending PR to add console exception logging functionality to core, but after talking to@fabpot, it turned to a cookbook article on how to do that on your own.

single: Console; Enabling logging

How to enable logging in Console Commands
===============================
Copy link
Member

Choose a reason for hiding this comment

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

The 'line' after a heading should be as long as the heading itself, could you please change this in this document?

@kostiklv
Copy link
ContributorAuthor

@wouterj, thanks for reviewing, I've addressed all of your comments.

for all commands you'd need to do something more.

First, you have to extend :class:`Symfony\\Bundle\\FrameworkBundle\\Console\\Application`
class to override its :method:`Symfony\\Bundle\\FrameworkBundle\\Console\\Application::run` method, where exception handling should happen::
Copy link
Member

Choose a reason for hiding this comment

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

You should break the line after the first word that crosses the 72th character

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed

}

Depending on the environment you run your command you will get the results
in ``app/dev.log`` or ``app/prod.log``.
Copy link
Member

Choose a reason for hiding this comment

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

the log dir isapp/logs/, notapp/

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch, thanks! Fixed.

weaverryan added a commit that referenced this pull requestDec 24, 2012
weaverryan added a commit that referenced this pull requestDec 24, 2012
The most important changes is to highlight that we're extending Symfony's code further than you *should*, which of course you're welcome to do, but we needs to be properly warned.
@weaverryanweaverryan merged commiteea9f7b intosymfony:2.0Dec 24, 2012
@weaverryan
Copy link
Member

Hi Konstantin!

I've merged this in and proofread it and made a few minor changes. I think it's a nice entry to highlight some of the more advanced parts of the command, but I did want to add a note since we're extending Symfony beyond what is normally recommended :).

Thanks1

@kostiklvkostiklv deleted the console-logging branchDecember 24, 2012 17:38
@kostiklv
Copy link
ContributorAuthor

Thanks, Ryan! I fully agree with your note.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@kostiklv@weaverryan@stof@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp