How to redirect stderr and stdout to a file

Hi friends
I am facing one problem while redirecting the out of the stderr and stdout to a file
let example my problem with a simple example
I have a file (say test.sh)in which i run 2 command in the background

ps -ef &
ls &

and now i am run this file and redirect the output to a file (say output.log)
./test.sh > output.log

Now the result stored in the file is not like that first ps -ef and than ls
it mixed the output of both command

Now help me so thats i can store the result in the file only one after another

Thanks

its because when you run them in background they will run simultaniously..

2>&1 ...
This replies to your thread title...

But I dont get you here, whats the point of launching these 2 cmds in background?

Its not cmds, I am taking it as a example , other are files which i did not explain here

This is not work in this case , i already try it

Ya i know , but what the way to come out from this problem

Run your whole shell script in the background; not the individual commands within the shell script.

Since we cannot understand whats your goal (since the examples you gave are not representatives...) either you agree with fmurphy's proposal or you create 2 separate output files...