Yes, using Profiler for this task is a really bad idea that can take down your system if you have a chatty workload that runs many short statements.
What you do is to set up the Trace to your liking in Profiler and maybe let it run for a few seconds as a test. Then you stop it, and from the File menu you select Export and Script Trace Definition. This gives you and SQL file that starts the trace. You need to edit the script to set the file name, and you may also want to change the file size, or else you may get a myriad of rollover files. Be sure to check the documentation for sp_trace_create so that you understand the parameters.
Now you will get a server-side Trace. It will still add an overhead, not the least if the system has the characteristics that I outlined above. But it is nowhere as severe as Profiler, because there is now UI slow things down.
When you set up a trace, be sure to set a stop time for the trace. You can do that on the first page when you set up the trace in Profiler.