You can use tcode WD_TRACE_TOOL to switch on trace.
After that when you launch your webdynpro application, you can observe there is a Webdynpro trace window embedded in the bottom of the application. You can either deactivate the trace in old dynpro tool or in that embedded window.
After you click Store trace as Zip File & Finish trace,you can save the trace file as zip locally.
The trace setting is checked and loaded in the very beginning phase of webdynpro runtime initialization,
The trace is actually added in the runtime via the utility macro below:
And finally into trace file with xml format