-
Notifications
You must be signed in to change notification settings - Fork 1k
Add logging configuration to the symfony sample #556
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! However I think we need to make this it's own section in the README and change a few things! Also I think it'd be great to have tests that actually verify logging/exception handling.
appengine/flexible/symfony/README.md
Outdated
@@ -20,6 +20,13 @@ Use composer to download Symfony Standard and its dependencies | |||
composer create-project symfony/symfony:^3.0 | |||
``` | |||
|
|||
# Add dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be more clear as Add Composer Dependencies
, but this enhancement would be better as a second section of the README, marked # Integrate Stackdriver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (with the next commit)
appengine/flexible/symfony/README.md
Outdated
@@ -31,13 +38,15 @@ git clone https://github.com/GoogleCloudPlatform/php-docs-samples /path/to/php-d | |||
|
|||
# copy the two files below to the root directory of your Symfony project | |||
cd /path/to/php-docs-samples/appengine/flexible/symfony/ | |||
cp ./{app.yaml,nginx-app.conf} /path/to/symfony | |||
cp app.yaml app/config/config_prod.yml \ | |||
src/AppBundle/EventSubscriber/ExceptionSubscriber.php /path/to/symfony |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work because it will copy these files into the root of their project, and so ExceptionSubscriber.php
will not be autoloaded, and config_prod.yaml
will not be in the config directory.
It would be better to add ExceptionSubscriber
to our client libraries, or instead of copying it over, explain in this tutorial how to add the exception Subscriber in symfony, and link to this doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the next commit
@bshaffer Ready for another look. The deployment test is passing locally |
appengine/flexible/symfony/README.md
Outdated
cp app.yaml /path/to/symfony | ||
cp app/config/config_prod.yml /path/to/symfony/app/config | ||
cp src/AppBundle/EventSubscriber/ExceptionSubscriber.php \ | ||
/path/to/symfony/src/AppBundle/EventSubscriber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By following this tutorial, the app won't have an AppBundle/EventSubscriber
directory. So we'll need to add a step to create that directory. Also, I would think we'd need to add AppBundle
to composer.json
for autoloading, but strangely the tests do not seem to do that, so I'm not totally sure how that class is being loaded and integrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a line for mkdir. The file is automatically loaded by symfony.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I missed it. Let's call out "Create a directory for the Exception Subscriber" in a comment and separate it from "copy the three files"
Looking at the composer.json
generated by symfony, I do not see anywhere that autoloading would occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bshaffer Done for the README.
It's automatically loaded. See:
http://symfony.com/doc/3.4/event_dispatcher.html
That's it! Your services.yml file should already be setup to load services from the EventSubscriber directory. Symfony takes care of the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
No description provided.