Need Header for all splitted files - awk

Input file: i have a file and need to split into multiple files based on first column. i need the header for all the splitted files. I'm unable to get the header.

$ cat log.txt
id,mailtype,value
1252468812,yahoo,3.5
1252468812,hotmail,2.4
1252468819,yahoo,1.2
1252468812,msn,8.9
1252468923,gmail,12
1252468819,live,3.4
1252468929,yahoo,9.0
1252468929,msn,1.2

Required:
Split the above files based on the first field (i.e. lines with same first field should go to the same file)

The awk one liner:

$ awk -F "," '{close(f);f=$1}{print > f".txt"}' log.txt

Output:
Above file is splited into the following sub-files.

$ cat 1252468812.txt
1252468812,yahoo,3.5
1252468812,hotmail,2.4
1252468812,msn,8.9
 
$ cat 1252468819.txt
1252468819,yahoo,1.2
1252468819,live,3.4
 
$ cat 1252468923.txt
1252468923,gmail,12
 
$ cat 1252468929.txt
1252468929,yahoo,9.0
1252468929,msn,1.2

Try:

awk -F "," '
!h{h=$0}
!a[$1]{a[$1]=$1; print h > $1 ".txt"}
{print > $1 ".txt"}' log.txt

Thanks for your quick response, but i need header for all the splitted files other than first column. How to acheive that.

Thanks in Advance!

awk -F "|" '
!h{h=$0}
!a[$1]{a[$1]=$1; print h > $1 ".txt"}
{print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 > $1 ".txt"}' test_file

What should be the header? Anyway, play around with something like this:

awk -F "|" '
!a[$1]{a[$1]=$1; print h > $1 ".txt"}
{print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 > $1 ".txt"}' h="co1 col2 .." test_file 

I need output like below

Input File:

id,mailtype,value

1252468812,yahoo,3.5
1252468812,hotmail,2.4
1252468819,yahoo,1.2
1252468812,msn,8.9
1252468923,gmail,12
1252468819,live,3.4
1252468929,yahoo,9.0
1252468929,msn,1.2

Output File1:

$ cat 1252468812.txt

mailtype,value
yahoo,3.5
hotmail,2.4
msn,8.9

Output File2:

$ cat 1252468819.txt
mailtype,value
yahoo,1.2
live,3.4

Output File3:

$ cat 1252468923.txt

mailtype,value
gmail,12

Output File4:

$ cat 1252468929.txt

mailtype,value
yahoo,9.0
msn,1.2

awk -F "|" '
!a[$1]{a[$1]=$1; print h > $1 ".txt"}
{print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 > $1 ".txt"}' h="mailtype,value" test_file

When i run that, its not coming out...its going to some loop i guess