I need help in Scripting...

I need a script:
I have an active log file that has multiple lines of information, (3 LINES with 4th line -------) need to copy the last 15 lines into one line only to another file.

Here's the copy of the log:

Date: Fri Jan 22 13:18:04 2010
XXXX alert for XXXXX instance OS host XXXXX at XXXXXXXX
The XXXXXX (XXXX)/ has XXX MB free, which is less than or equal to the specified XXXXXX threshold of XXXX MB.
----------------------------------------------------------------------
Date: Fri Jan 22 13:18:28 2010
RedAlert EXCEPTION from REDALERT on host whsemr02
Failed to execute Cache command attempting to find current user's roles in the BLD instance.
----------------------------------------------------------------------

Hi.

Not sure if this is what you mean:

echo $(tail -15 logfile) > newfile

Can you clarify the question a bit?

i.e. what 3 LINES plus 4th line has to do with the last 15 lines and perhaps show how the output should look?

The log/file I want to copy is an active log and it gets updated when an error occur so eventully this log will be huge so what I want to do is copy the last 15 lines and put it another file. I was also thinkin of copyin the file by stamped date/time ie when the logfile gets a new message.
When an error occur it has 4 lines, 1st line:date information 2nd line:severity of error 3rd line is explanation of error and 4th line is dashes -----
all 4 lines are just one error

You may want to take a look at logrotate to prevent this log file getting too enormous by keeping older entries in numbered copies of the log file, logrotate can do an action called copytruncate while rolling the log files if the current log file is always held open by the writing process.