getLogDir() 공개 메소드

public getLogDir ( )
 public function getLogDir()
 {
     if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
         return sprintf('/tmp/symfony/music/log/%s', $this->environment);
     }
     return parent::getLogDir();
 }
예제 #2
0
 public function getLogDir()
 {
     if (array_key_exists('LOG_DIR', $_ENV)) {
         return $_ENV['LOG_DIR'] . DIRECTORY_SEPARATOR . $this->environment;
     }
     return parent::getLogDir();
 }
 public function getLogDir()
 {
     if ($this->gcsBucketName) {
         return sprintf('gs://%s/symfony/log', $this->gcsBucketName);
     }
     return parent::getLogDir();
 }
예제 #4
0
파일: AppKernel.php 프로젝트: msvrtan/cqrs1
 public function getLogDir()
 {
     if ($this->getRootDir() === '/vagrant/app' && in_array($this->environment, ['dev', 'test'])) {
         return '/dev/shm/appname/logs';
     }
     return parent::getLogDir();
 }
예제 #5
0
 public function getLogDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return sys_get_temp_dir() . '/jumph/logs';
     }
     return parent::getLogDir();
 }
예제 #6
0
 public function getLogDir()
 {
     if ($this->vagrant) {
         return '/dev/shm/sages/logs/';
     }
     return parent::getLogDir();
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 public function getLogDir()
 {
     if ($this->isVagrantEnvironment()) {
         return '/dev/shm/composer-service/logs';
     }
     return parent::getLogDir();
 }
예제 #8
0
 /**
  * @see \Symfony\Component\HttpKernel\Kernel::getLogDir()
  */
 public function getLogDir()
 {
     if (in_array($this->environment, ['dev', 'test'])) {
         return '/dev/shm/librarian/logs';
     }
     return parent::getLogDir();
 }
 public function getLogDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return '/dev/shm/symfony/logs';
     }
     return parent::getLogDir();
 }
예제 #10
0
 /**
  * {@inheritdoc}
  */
 public function getLogDir()
 {
     if ($this->isVagrantEnvironment()) {
         return '/dev/shm/sylius/logs';
     }
     return parent::getLogDir();
 }
예제 #11
0
 public function getLogDir()
 {
     if (in_array($this->getEnvironment(), array('dev', 'ci'))) {
         return '/dev/shm/' . $this->getEnvironment() . '/logs/';
     }
     return parent::getLogDir();
 }
예제 #12
0
 public function getLogDir()
 {
     if (in_array($this->environment, ['dev', 'test']) && $this->logDir) {
         return $this->logDir;
     }
     return parent::getLogDir();
 }
예제 #13
0
 public function getLogDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return '/home/vagrant/stecnico/logs';
     }
     return parent::getLogDir();
 }
예제 #14
0
 public function getLogDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return $this->getRootDir() . '/logs';
     }
     return parent::getLogDir();
 }
예제 #15
0
파일: AppKernel.php 프로젝트: ubc/examdb
 public function getLogDir()
 {
     if (false !== getEnv('OPENSHIFT_LOG_DIR')) {
         return getEnv('OPENSHIFT_LOG_DIR');
     } else {
         return parent::getLogDir();
     }
 }
예제 #16
0
 public function getLogDir()
 {
     if ($this->getEnvironment() == 'prod') {
         if (!is_dir(sys_get_temp_dir() . '/sf2standard/logs')) {
             mkdir(sys_get_temp_dir() . '/sf2standard/logs', 0777, true);
         }
         return sys_get_temp_dir() . '/sf2standard/logs';
     }
     return parent::getLogDir();
 }
예제 #17
0
 /**
  * Returns path to cache dir.
  *
  * See README on how to override this
  *
  * @return string
  * @throws RuntimeException
  */
 public function getLogDir()
 {
     static $s_dir;
     if ($s_dir) {
         return $s_dir;
     }
     if (self::DEFAULT_LOGS_DIR && (is_dir(self::DEFAULT_LOGS_DIR) || @mkdir(self::DEFAULT_LOGS_DIR, 0777, true)) && is_writeable(self::DEFAULT_LOGS_DIR)) {
         return $s_dir = self::DEFAULT_LOGS_DIR;
     }
     $symfonyDefaultDir = parent::getLogDir();
     if (is_dir($symfonyDefaultDir) && is_writeable($symfonyDefaultDir)) {
         return $s_dir = $symfonyDefaultDir;
     }
     throw new \RuntimeException("Unable to write log file!" . PHP_EOL . "This is because:" . PHP_EOL . (self::DEFAULT_LOGS_DIR ? "* Configured directory '" . self::DEFAULT_LOGS_DIR . "' does not exist, can not be created or is not writable for the current user." : "* No configured directory ('logs_dir' setting in module_janus.php).") . PHP_EOL . "* And default logs dir '{$symfonyDefaultDir}' does not exist or is not writable for the current user.");
 }
예제 #18
0
 public function getLogDir()
 {
     if (static::$logDir) {
         return static::$logDir;
     }
     $yaml = new Yaml();
     $env = $this->getEnvironment();
     $parameters = $yaml::parse(file_get_contents(__DIR__ . '/config/parameters.yml'));
     $config = $yaml::parse(file_get_contents(__DIR__ . "/config/config_{$env}.yml"));
     if (!empty($parameters['parameters']['log_dir'])) {
         static::$logDir = $parameters['parameters']['log_dir'];
     } elseif (!empty($config['parameters']['log_dir'])) {
         static::$logDir = $config['parameters']['log_dir'];
     } else {
         static::$logDir = parent::getLogDir();
     }
     if (!is_dir(static::$logDir)) {
         @mkdir(static::$logDir, 0777, true);
         @chgrp(static::$logDir, 'www-data');
     }
     return static::$logDir;
 }
예제 #19
0
 /**
  * {@inheritdoc}
  *
  * @api
  */
 public function getLogDir()
 {
     $parameters = $this->getLocalParams();
     if (isset($parameters['log_path'])) {
         return str_replace('%kernel.root_dir%', $this->getRootDir(), $parameters['log_path']);
     } else {
         return parent::getLogDir();
     }
 }
예제 #20
0
 public function getLogDir()
 {
     return parent::getLogDir() . '/logs';
 }
예제 #21
0
 /**
  * Gets the log directory.
  *
  * @return string The log directory
  *
  * @api
  */
 public function getLogDir()
 {
     if (defined('THELIA_ROOT')) {
         return THELIA_LOG_DIR;
     } else {
         return parent::getLogDir();
     }
 }
예제 #22
0
 /**
  *  Vagrant optimisation: set log directory in the vm
  *
  * @return string
  */
 public function getLogDir()
 {
     $envParameters = $this->getEnvParameters();
     if (isset($envParameters['vagrant']) && $envParameters['vagrant'] === "1") {
         return '/dev/shm/vagrant/logs';
     }
     return parent::getLogDir();
 }
 /**
  * Collects information about the Symfony kernel.
  *
  * @return Value\SymfonyKernelSystemInfo
  */
 public function collect()
 {
     ksort($this->bundles, SORT_FLAG_CASE | SORT_STRING);
     return new Value\SymfonyKernelSystemInfo(['environment' => $this->kernel->getEnvironment(), 'debugMode' => $this->kernel->isDebug(), 'version' => Kernel::VERSION, 'bundles' => $this->bundles, 'rootDir' => $this->kernel->getRootDir(), 'name' => $this->kernel->getName(), 'cacheDir' => $this->kernel->getCacheDir(), 'logDir' => $this->kernel->getLogDir(), 'charset' => $this->kernel->getCharset()]);
 }
예제 #24
0
 /**
  * @inheritDoc
  *
  * contains some experimental code for custom log directories
  * for multiple sites.
  *
  * @todo find something that works for both console and web
  */
 public function getLogDir()
 {
     if (isset($_SERVER[self::EXTERNAL_CACHE_BASE_TOGGLE])) {
         return sprintf('/var/zenmagick/%s/%s/logs', $_SERVER[self::EXTERNAL_USER_DIR_KEY], $_SERVER[self::EXTERNAL_HOST_DIR_KEY]);
     }
     return parent::getLogDir();
 }
예제 #25
0
 /**
  * Create the logger service.
  *
  * @param Kernel   $kernel         The kernel to retrieve the log dir from.
  *
  * @param string   $filename       The filename.
  *
  * @param int      $maxFiles       The maximal amount of files to keep (0 means unlimited).
  *
  * @param int      $level          The minimum logging level at which this handler will be triggered.
  *
  * @param bool     $bubble         Whether the messages that are handled can bubble up the stack or not.
  *
  * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write).
  *
  * @param bool     $useLocking     Try to lock log file before doing any writes.
  *
  * @return RotatingFileHandler
  */
 public static function create($kernel, $filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
 {
     return new RotatingFileHandler($kernel->getLogDir() . DIRECTORY_SEPARATOR . $filename, $maxFiles, $level, $bubble, $filePermission, $useLocking);
 }