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');
			}
		}
	}