@@ -22,17 +22,18 @@ Preparing your Application
22
22
~~~~~~~~~~~~~~~~~~~~~~~~~~
23
23
24
24
Deploying a Symfony2 application to Heroku doesn't require any change in its
25
- code, but it requires some minor tweaks in its configuration.
25
+ code, but it requires some minor tweaks to its configuration.
26
26
27
27
By default, the Symfony2 app will log into your application's ``app/log/ ``
28
- directory, which isn't ideal as Heroku uses an `ephemeral file system `_. On
29
- Heroku, the best way to handle logging is using Logplex, and the best way to
30
- send log data to Logplex is by writing to ``STDERR `` or ``STDOUT ``. Luckily
31
- Symfony2 uses the excellent Monolog library for logging and so a new log
32
- destination is just a config file change away.
33
-
34
- Open ``app/config/config_prod.yml `` file, locate ``monolog/handlers/nested ``
35
- section and change the value of ``path `` from
28
+ directory. This is not ideal as Heroku uses an `ephemeral file system `_. On
29
+ Heroku, the best way to handle logging is using `Logplex `_. And the best way to
30
+ send log data to Logplex is by writing to ``STDERR `` or ``STDOUT ``. Luckily,
31
+ Symfony2 uses the excellent Monolog library for logging. So, a new log
32
+ destination is just a change to a config file away.
33
+
34
+ Open the ``app/config/config_prod.yml `` file, locate the
35
+ ``monolog/handlers/nested `` section (or create it if it doesn't exist yet) and
36
+ change the value of ``path `` from
36
37
``"%kernel.logs_dir%/%kernel.environment%.log" `` to ``"php://stderr" ``:
37
38
38
39
.. code-block :: yaml
@@ -49,7 +50,7 @@ section and change the value of ``path`` from
49
50
Once the application is deployed, run ``heroku logs --tail `` to keep the
50
51
stream of logs from Heroku open in your terminal.
51
52
52
- Creating a New Application on Heroku
53
+ Creating a new Application on Heroku
53
54
------------------------------------
54
55
55
56
To create a new Heroku application that you can push to, use the CLI ``create ``
@@ -190,4 +191,5 @@ You should be seeing your Symfony2 application in your browser.
190
191
.. _`Heroku Toolbet` : https://devcenter.heroku.com/articles/getting-started-with-php#local-workstation-setup
191
192
.. _`getting Started with PHP on Heroku` : .. _`Heroku Toolbet`: https://devcenter.heroku.com/articles/getting-started-with-php
192
193
.. _`ephemeral file system` : https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem
194
+ .. _`Logplex` : https://devcenter.heroku.com/articles/logplex
193
195
.. _`verified that the RSA key fingerprint is correct` : https://devcenter.heroku.com/articles/git-repository-ssh-fingerprints
0 commit comments