PROC PRINTTO uses LOG= to route the SAS log to an external file. By default, this log is appended to the current contents of log-file. See Portion of Log Routed to an External File .
proc printto log='log-file';
   run;