(This is regarding Adobe changing the trace output location done by 
the debug flash player supplied with Flex 2.0.1 to C:\Documents and 
Settings\{UserName}\Application Data\Macromedia\Flash Player\Logs)

As I use the trace output from the flash player for my companies 
flex continuous integration system (flexunit test results etc...) I 
have had to investigate this much further.  Here is what I have found 
which I hope is useful to other developers:

Although Adobe have changed the debug player so it always outputs to 
the \Documents and Settings\{UserName}\Application 
Data\Macromedia\Flash Player\Logs, it is still possible to redirect 
the output to another location by overriding the USERPROFILE 
environment variable, using the following technique for example:

Step 1) Create a new directory C:\FlexTrace

Step 2) Under C:\FlexTrace directory, create the directory 
\Application Data\Macromedia\Flash Player\Logs, so you end up with 
the following directory structure:

   C:\FlexTrace
        \Application Data
           \Macromedia
              \Flash Player
                 \Logs

Step 3) In directory C:\Documents and Settings\{UserName}, create a 
mm.cfg file which contains the following lines:
      ErrorReportingEnable=1
      TraceOutputFileEnable=1      

Step 4) From a windows command shell, type: set 
USERPROFILE=C:\FlexTrace

Step 5) Execute a swf which includes trace (i.e. type 
SAFlashPlayer.exe <file.swf> from the command prompt)

Step 6) If you then look in directory C:\FlexTrace\Application 
Data\Macromedia\Flash Player\Logs you will find the file called 
flashlog.txt created.

Notes For Above:

>From my tests, the environment variables HOMEDRIVE and HOMEPATH are 
no longer used for the location of the mm.cfg file (it MUST be in 
the  location specified in step 3).

Permanently overriding the environment variable USERPROFILE is 
obviously not a good idea, so for step 4 you would normally make that 
change just for the time you need it (for example in an ANT script 
make it a local change when using the exec task).

There doesn't seem to be any way now to specify a trace filename, so 
the easiest solution would be just to move/rename the flashlog.txt 
file when your swf task is complete (i.e. if doing unit test runs).

You will notice that the flash player will (when some trace has been 
written) create additional directories in the same sub-directory as 
the Logs directory.

Philip Carlin.

Reply via email to