PHP Class DeploynautLogFile

Show file Open project: silverstripe/deploynaut Class Usage Examples

Protected Properties

Property Type Description
$basePath
$logFile

Public Methods

Method Description
__construct ( string $logFile, string | null $basePath = null )
content ( ) : string Return the content of the log file.
exists ( ) : boolean Does the log file exist?
getLogFilePath ( ) : string | null Return log file path, assuming it exists. Returns NULL if nothing found.
getRawFilePath ( ) : string Return the un-sanitised log path.
getSanitisedLogFilePath ( ) : string Get the sanitised log path.
setBasePath ( string $path ) Set the base path of where logs reside
setLogFile ( string $filename ) Set the log filename
write ( string $message ) Write a message line into the log file.

Method Details

__construct() public method

public __construct ( string $logFile, string | null $basePath = null )
$logFile string The log filename
$basePath string | null Base path of where logs reside. Defaults to DEPLOYNAUT_LOG_PATH

content() public method

Return the content of the log file.
public content ( ) : string
return string

exists() public method

Does the log file exist?
public exists ( ) : boolean
return boolean

getLogFilePath() public method

Return log file path, assuming it exists. Returns NULL if nothing found.
public getLogFilePath ( ) : string | null
return string | null

getRawFilePath() public method

Return the un-sanitised log path.
public getRawFilePath ( ) : string
return string

getSanitisedLogFilePath() public method

Get the sanitised log path.
public getSanitisedLogFilePath ( ) : string
return string

setBasePath() public method

Set the base path of where logs reside
public setBasePath ( string $path )
$path string

setLogFile() public method

Set the log filename
public setLogFile ( string $filename )
$filename string

write() public method

Write a message line into the log file.
public write ( string $message )
$message string

Property Details

$basePath protected property

protected $basePath

$logFile protected property

protected $logFile