This really only matches the syntax of the limited log snippet you gave us, but it should do for a start. It runs through the log file line-by-line and does its best to keep track of which dated section it's in.
<?php
$logfile = '/path/to/the/file.log';
$fh = fopen($logfile, 'r') or die("can't open file.");
$r_delim = '/^=*$/'; // matches lines of only =
$r_time = '/^\[(.*)\] - .*$/'; // matches lines that start with [, captures contents between [ and ]
$r_error = '/ Error: /'; // matches lines that contain the string ' Error: '
$skip_delim = FALSE;
$last_timestamp = 'no stamp';
$matches = array();
while($line = fgets($fh)) {
if( preg_match($r_delim, $line) && ! $skip_delim) {
$line = fgets($fh);
preg_match($r_time, $line, $matches);
$last_timestamp = $matches[1];
$skip_delim = TRUE;
} else if( preg_match($r_delim, $line) && $skip_delim ) {
$skip_delim = FALSE;
} else if( preg_match($r_error, $line) ) {
printf('%s :: %s', $last_timestamp, $line);
}
}
Output:
Jan 25 2012 11:26:03 :: Error opening document: /the/path/to/file/some_file_name_lo.indd: Error: Either the file does not exist, you do not have permission, or the file may be in use by another application; line: 190
Feb 24 2012 15:57:43 :: extendedPrintPDF: Error: Unsaved documents have no full name.; line: 332
Feb 24 2012 15:57:43 :: extendedPrintPDF: Error: Unsaved documents have no full name.; line: 332