protected function initFile()
	{
		// If the file doesn't already exist we need to create it and generate the file header.
		if (!is_file($this->path))
		{
			// Make sure the folder exists in which to create the log file.
			Folder::create(dirname($this->path));

			// Build the log file header.
			$head = $this->generateFileHeader();
		}
		else
		{
			$head = false;
		}

		// Open the file for writing (append mode).
		if (!$this->file = fopen($this->path, 'a'))
		{
			throw new \RuntimeException('Cannot open file for writing log');
		}

		if ($head)
		{
			if (!fwrite($this->file, $head))
			{
				throw new \RuntimeException('Cannot fput file for log');
			}
		}
	}
protected function initFile()
	{
		// If the file doesn't already exist we need to create it and generate the file header.
		if (!is_file($this->path))
		{
			// Make sure the folder exists in which to create the log file.
			Folder::create(dirname($this->path));

			// Build the log file header.
			$head = $this->generateFileHeader();
		}
		else
		{
			$head = false;
		}

		// Open the file for writing (append mode).
		if (!$this->file = fopen($this->path, 'a'))
		{
			throw new \RuntimeException('Cannot open file for writing log');
		}

		if ($head)
		{
			if (!fwrite($this->file, $head))
			{
				throw new \RuntimeException('Cannot fput file for log');
			}
		}
	}
protected function initFile ( ) { // If the file doesn't already exist we need to create it and generate the file header. if ( ! is_file ( $ this -> path ) ) { // Make sure the folder exists in which to create the log file. Folder :: create ( dirname ( $ this -> path ) ) ; // Build the log file header. $ head = $ this -> generateFileHeader ( ) ; } else { $ head = false ; } // Open the file for writing (append mode). if ( ! $ this -> file = fopen ( $ this -> path , 'a' ) ) { throw new \ RuntimeException ( 'Cannot open file for writing log' ) ; } if ( $ head ) { if ( ! fwrite ( $ this -> file , $ head ) ) { throw new \ RuntimeException ( 'Cannot fput file for log' ) ; } } }
Method to initialise the log file.  This will create the folder path to the file if it doesn't already
exist and also get a new file header if the file doesn't already exist.  If the file already exists it
will simply open it for writing.

@return  void

@since   1.0
@throws  \RuntimeException
Method to initialise the log file . This will create the folder path to the file if it doesn t already exist and also get a new file header if the file doesn t already exist . If the file already exists it will simply open it for writing .