Skip to content

changed the logger from zend to monolog #445

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ of the ``AppKernel`` class:
// ...
new Acme\HelloBundle\AcmeHelloBundle(),
);

// ...

return $bundles;
Expand Down Expand Up @@ -418,7 +418,7 @@ use a Kernel class, ``AppKernel``, to bootstrap the application.
Having a front controller means different and more flexible URLs than
are used in a typical flat PHP application. When using a front controller,
URLs are formatted in the following way:

.. code-block:: text

http://localhost/app.php/hello/Ryan
Expand All @@ -427,7 +427,7 @@ use a Kernel class, ``AppKernel``, to bootstrap the application.
is routed internally using the routing configuration. By using Apache
``mod_rewrite`` rules, you can force the ``app.php`` file to be executed without
needing to specify it in the URL:

.. code-block:: text

http://localhost/hello/Ryan
Expand Down Expand Up @@ -475,12 +475,12 @@ about each of these directories in later chapters.
or ``require`` statements. Instead, Symfony2 uses the namespace of a class
to determine its location and automatically includes the file on your
behalf the instant you need a class::

$loader->registerNamespaces(array(
'Acme' => __DIR__.'/../src',
// ...
));

With this configuration, Symfony2 will look inside the ``src`` directory
for any class in the ``Acme`` namespace (your pretend company's namespace).
For autoloading to work, the class name and path to the file must follow
Expand Down Expand Up @@ -712,7 +712,7 @@ format you prefer:

<!-- Twig Configuration -->
<twig:config debug="%kernel.debug%" strict-variables="%kernel.debug%" />

<!-- ... -->

.. code-block:: php
Expand Down Expand Up @@ -806,9 +806,9 @@ call the ``prod`` front controller instead:

If you open the ``web/app.php`` file, you'll find that it's configured explicitly
to use the ``prod`` environment::

$kernel = new AppCache(new AppKernel('prod', false));

You can create a new front controller for a new environment by copying
this file and changing ``prod`` to some other value.

Expand Down Expand Up @@ -861,10 +861,12 @@ the configuration file for the ``dev`` environment.
toolbar: true
intercept_redirects: true

zend:
logger:
priority: debug
path: %kernel.logs_dir%/%kernel.environment%.log
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
Copy link
Member

Choose a reason for hiding this comment

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

if you want the minimal config, remove the path and the level as you are using the default values :)


.. code-block:: xml

Expand All @@ -883,9 +885,14 @@ the configuration file for the ``dev`` environment.
intercept-redirects="true"
/>

<zend:config>
<zend:logger priority="info" path="%kernel.logs_dir%/%kernel.environment%.log" />
</zend:config>
<monolog:config>
<monolog:handler
name="main"
type="stream"
path="%kernel.logs_dir%/%kernel.environment%.log"
level="debug"
>
</monolog:config>

.. code-block:: php

Expand All @@ -902,12 +909,14 @@ the configuration file for the ``dev`` environment.
'intercept-redirects' => true,
));

$container->loadFromExtension('zend', array(
'logger' => array(
'priority' => 'info',
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
),
));
$container->loadFromExtension('monolog', array(
'handlers' => array(
'main' => array(
'type' => 'stream',
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
'level' => 'debug',
),
)));

The ``imports`` key is similar to a PHP ``include`` statement and guarantees
that the main configuration file (``config.yml``) is loaded first. The rest
Expand Down
10 changes: 6 additions & 4 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,12 @@ and then modifies it to add some debugging tools:
toolbar: true
intercept_redirects: false

zend:
logger:
priority: debug
path: %kernel.logs_dir%/%kernel.environment%.log
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug

assetic:
use_controller: true
Expand Down