AppserverIo\Appserver\Core\Api\AbstractService::getLogDir PHP Method

getLogDir() public method

Returns the servers log directory.
public getLogDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
return string
    public function getLogDir($relativePathToAppend = '')
    {
        return $this->realpath($this->makePathAbsolute($this->getSystemConfiguration()->getParam(DirectoryKeys::VAR_LOG) . $this->makePathAbsolute($relativePathToAppend)));
    }

Usage Example

 /**
  * Tests if getting just the log directory works
  *
  * @return null
  */
 public function testGetLogDirNothingToAppend()
 {
     $logDir = $this->service->getLogDir();
     $this->assertEquals('/opt/appserver/var/log', $logDir);
     $this->assertNotEquals('/opt/appserver/var/log/test/directory', $logDir);
 }