コード例 #1
0
 /**
  * @param ConsoleLogger $logger
  * @param Config $config
  */
 public function logServerConfig(ConsoleLogger $logger, Config $config)
 {
     $logger->info("* config port       :" . $config->getPort());
     $logger->info("* config log_file   :" . $config->getLogFile());
     $logger->info("* config pid_file   :" . $config->getPidFile());
     $logger->info("* config classpaths :" . implode(',', $config->getClasspaths()));
     $logger->info("* config java_bin   :" . $config->getJavaBin());
     $logger->info("* config server_jar :" . $config->getServerJar());
 }
コード例 #2
0
 /**
  * Return the content of the output_file.
  *
  * @throws Exception\RuntimeException
  *
  * @return string
  */
 public function getOutput()
 {
     $log_file = $this->config->getLogFile();
     if (!file_exists($log_file)) {
         $msg = "Server output log file does not exists '{$log_file}'";
         $this->logger->error("Get server output failed: {$msg}");
         throw new Exception\RuntimeException($msg);
     } elseif (!is_readable($log_file)) {
         $msg = "Cannot read log file do to missing read permission '{$log_file}'";
         $this->logger->error("Get server output failed: {$msg}");
         throw new Exception\RuntimeException($msg);
     }
     $output = file_get_contents($log_file);
     return $output;
 }