Skip to content
Merged
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
8 changes: 8 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,19 @@ public function getRootDir()

public function getCacheDir()
{
if (in_array($this->environment, ['dev', 'test'])) {
Copy link

Choose a reason for hiding this comment

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

@michaelperrin same thing that for the log dir.

Copy link
Owner Author

@michaelperrin michaelperrin May 18, 2016

Choose a reason for hiding this comment

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

Thank you @shouze for your nice tips!
I am still pretty new to Docker (I have more advanced uses of it in real projects though), so if you have any link to an example showing an implementation of log redirection for a Symfony app in a Docker container that would be great! Should I simply output Symfony logs to stderr or stdout?
I will otherwise dig into it.

return '/dev/shm/symfony_docker_test/cache/'.$this->environment;
}

return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}

public function getLogDir()
{
if (in_array($this->environment, ['dev', 'test'])) {
Copy link

Choose a reason for hiding this comment

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

@michaelperrin should not be environment dependent in fact... running a symfony app in docker, you should NEVER write logs in local files in fact, you should log everything on stdout & use something like logspout or docker log drivers to aggregate logs where you want ;)

return '/dev/shm/symfony_docker_test/logs';
}

return dirname(__DIR__).'/var/logs';
}

Expand Down