Skip to content

[4.0] Fix default log directory name #8547

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

Merged
merged 1 commit into from
Oct 27, 2017
Merged
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
2 changes: 1 addition & 1 deletion best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ following:
* ``src/AppBundle/``, stores the Symfony specific code (controllers and routes),
your domain code (e.g. Doctrine classes) and all your business logic;
* ``var/cache/``, stores all the cache files generated by the application;
* ``var/logs/``, stores all the log files generated by the application;
* ``var/log/``, stores all the log files generated by the application;
* ``var/sessions/``, stores all the session files generated by the application;
* ``tests/AppBundle/``, stores the automatic tests (e.g. Unit tests) of the
application.
Expand Down
2 changes: 1 addition & 1 deletion configuration/micro_kernel_trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ hold the kernel. Now it looks like this::
// optional, to use the standard Symfony logs directory
public function getLogDir()
{
return __DIR__.'/../var/logs';
return __DIR__.'/../var/log';
}
}

Expand Down
2 changes: 1 addition & 1 deletion configuration/multiple_kernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ they don't collide with the files from ``AppKernel``::

public function getLogDir()
{
return dirname(__DIR__).'/var/logs/api';
return dirname(__DIR__).'/var/log/api';
}

public function registerContainerConfiguration(LoaderInterface $loader)
Expand Down
4 changes: 2 additions & 2 deletions configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ method::

public function getLogDir()
{
return dirname(__DIR__).'/var/'.$this->environment.'/logs';
return dirname(__DIR__).'/var/'.$this->environment.'/log';
}
}

Here you have changed the location of the directory to ``var/{environment}/logs``.
Here you have changed the location of the directory to ``var/{environment}/log``.

.. _override-templates-dir:

Expand Down
4 changes: 2 additions & 2 deletions deployment/azure-website.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ directory with at least the following contents:
/var/bootstrap.php.cache
/var/cache/*
/app/config/parameters.yml
/var/logs/*
/var/log/*
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/log/.gitkeep
/var/SymfonyRequirements.php
/build/
/vendor/
Expand Down
2 changes: 1 addition & 1 deletion deployment/platformsh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Platform.sh how to deploy your application (read more about
# The mounts that will be performed when the package is deployed.
mounts:
'/var/cache': 'shared:files/cache'
'/var/logs': 'shared:files/logs'
'/var/log': 'shared:files/log'

# The hooks that will be performed when the package is deployed.
hooks:
Expand Down
6 changes: 3 additions & 3 deletions logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ The configuration for *where* logs are stored lives in the specific
:doc:`environment </configuration/environments>` configuration files: ``config_dev.yml``
and ``config_prod.yml``.

By default, log entries are written to the ``var/logs/dev.log`` file when you're in
the ``dev`` environment. In the ``prod`` environment, logs are written to ``var/logs/prod.log``,
By default, log entries are written to the ``var/log/dev.log`` file when you're in
the ``dev`` environment. In the ``prod`` environment, logs are written to ``var/log/prod.log``,
but *only* during a request where an error or high-priority log entry was made
(i.e. ``error()`` , ``critical()``, ``alert()`` or ``emergency()``).

Expand Down Expand Up @@ -77,7 +77,7 @@ to write logs using the :phpfunction:`syslog` function:
# this "file_log" key could be anything
file_log:
type: stream
# log to var/logs/(environment).log
# log to var/log/(environment).log
path: "%kernel.logs_dir%/%kernel.environment%.log"
# log *all* messages (debug is lowest level)
level: debug
Expand Down
2 changes: 1 addition & 1 deletion page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ So what about the other directories in the project?

``var/``
This is where automatically-created files are stored, like cache files
(``var/cache/``), logs (``var/logs/``) and sessions (``var/sessions/``).
(``var/cache/``), logs (``var/log/``) and sessions (``var/sessions/``).

``vendor/``
Third-party (i.e. "vendor") libraries live here! These are downloaded via the `Composer`_
Expand Down
2 changes: 1 addition & 1 deletion quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ the ``prod`` environment:
$ php bin/console cache:clear --env=prod

When developing a web application, things can go wrong in many ways. The
log files in the ``var/logs/`` directory tell you everything about the requests
log files in the ``var/log/`` directory tell you everything about the requests
and help you fix the problem quickly.

Using the Command Line Interface
Expand Down
2 changes: 1 addition & 1 deletion reference/configuration/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ This returns the path to the cache directory. To change it, override the
Log Directory
~~~~~~~~~~~~~

**type**: ``string`` **default**: ``$this->rootDir/logs``
**type**: ``string`` **default**: ``$this->rootDir/log``

This returns the path to the log directory. To change it, override the
:method:`Symfony\\Component\\HttpKernel\\Kernel::getLogDir` method. Read
Expand Down
2 changes: 1 addition & 1 deletion setup/file_permissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ needed permissions:
.. code-block:: terminal

$ rm -rf var/cache/*
$ rm -rf var/logs/*
$ rm -rf var/log/*

$ HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var
Expand Down
6 changes: 3 additions & 3 deletions setup/new_project_svn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ with these steps:
.. code-block:: terminal

$ cd myproject/
$ svn add --depth=empty app var var/cache var/logs app/config web
$ svn add --depth=empty app var var/cache var/log app/config web

$ svn propset svn:ignore "vendor" .
$ svn propset svn:ignore "bootstrap*" var/
$ svn propset svn:ignore "parameters.yml" app/config/
$ svn propset svn:ignore "*" var/cache/
$ svn propset svn:ignore "*" var/logs/
$ svn propset svn:ignore "*" var/log/
$ svn propset svn:ignore "*" var/sessions/

$ svn propset svn:ignore "bundles" web

$ svn ci -m "commit basic Symfony ignore list (vendor, var/bootstrap*, app/config/parameters.yml, var/cache/*, var/logs/*, web/bundles)"
$ svn ci -m "commit basic Symfony ignore list (vendor, var/bootstrap*, app/config/parameters.yml, var/cache/*, var/log/*, web/bundles)"

#. The rest of the files can now be added and committed to the project:

Expand Down