The SYSPRINTTOLOG option contains the current redirect of the log as can be set using the following code:

proc printto log="/some/new/loc.log"; 
%put new location = &SYSPRINTTOLOG;
proc printto log=log;
data _null_;
  infile "/some/new/loc.log";
  input; putlog _infile_;
%put value is now blank:  &SYSPRINTTOLOG;

Note that the variable value is null when the log is not being redirected.

This feature only became available on all platforms since 9.4 M3 (source).

See documentation for more info: