how to create a logfile to track the below script output

Hi Dudes,

Can you please suggest me how to create a logfile to track the below script output ? Thanks

#!/bin/ksh
# backup the "std" I/P file descriptor
exec 5<&0
#echo "Proceed ?"
while read config_line; do
# backup the I/P file descriptor of "while" block
exec 6<&0
# restore the "std" I/P file descriptor
exec 0<&5
script_type=`print $config_line | awk -F" " '{print $2}'`
script_name=`print $config_line | awk -F" " '{print $3}'`
script_path=`print $config_line | awk -F" " '{print $4}'`
#echo "script_type = ${script_type}"
#echo "script_name = ${script_name}"
#echo "script_path = ${script_path}"
if [[ ! -x ${script_path}/${script_name} ]]; then
print "Either there is NO such FIle / Path or Execute permission is not set for ${script_name}."
exit 1;
fi
cd $script_path;
print "Started executing the script, ${script_name} ..."
if [[ ${script_type} = 's' ]] || [[ ${script_type} = 'S' ]]; then
./${script_name};
retval = $?;
elif [[ ${script_type} = 'r' ]] || [[ ${script_type} = 'R' ]]; then
run_script.ksh ${script_name};
retval = $?;
fi

if [[ ${retval} -ne 0 ]]; then
print "${script_name} script is Failed."
else
print "${script_name} script is successfully completed."
fi
# restore the I/P file descriptor of "while" block & close the fd of 51
exec 0<&6 6<&-
done < config.txt

Have you tried simply redirecting? Try this as the last line:

done < config.txt > config.out

Try this,

sh script.sh 2&>log_file