Debugging Flex applications with mm.cfg and flashlog.txt

When working with Flex applications, it may useful to see the output from the trace() function. Well, the good news is that if you have the debug version of the Flash Player installed, it is really easy to redirect the trace() output to an external file which can you browse using any text editor.

There are lots of excellent online resources for this already, but here is a brief run-down…

Create a file named “mm.cfg” in one of the following locations:

  • Windows; C:\Documents and Settings\username\mm.cfg
  • OSX; /Library/Application Support/Macromedia/mm.cfg
  • Linux; home/username/mm.cfg

Open the newly created mm.cfg file in a text editor and add the following text:

ErrorReportingEnable=1
TraceOutputFileEnable=1

The flashlog.txt file will be created in the following location:

  • Windows; C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt
  • OSX; /Users/username/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt
  • Linux; home/username/Macromedia/Flash_Player/Logs/flashlog.txt

For more information see “Logging”, “Configuring the debugger version of Flash Player” and “Configuring the debugger version of Flash Player to record trace() output” in the Flex 2.0.1 documentation.

You can also check out the “Debugging Client-Side Code in Flex Applications” article in the Adobe Flex Developer Center (although note that the article was written March, 15 2004, and some information may not be 100% accurate anymore).

If you are still having problems, check out the following Adobe Technote on “Troubleshooting tips for flashlog.txt not being generated”.

For more information, check out Mark Walters’s excellent post over on digitalflipbook.com, “Trace from the browser, using standard trace()”.

Frequently Asked Questions

Q: How do I know if I have the debug version of the Flash Player already installed?
A: Finding your Flash Player version, and whether or not your Flash Player is a debug version is done by checking the version and isDebugger properties of the flash.system.Capabilities class.

Q: Where can I download a debug version of the Flash Player if I don’t have one already installed?
A: You can download nightly builds of the Flex 3 SDK from the “Adobe Labs – Flex 3 Software Development Kit” page. Simply download and extract a ZIP file, and go to the following directory: “flex_sdk_3.zip\runtimes\player”. In this folder you should find three subfolders: “lnx”, “mac”, and “win” for the Linux, Macintosh and Windows operating systems respectively. Navigate to your appropriate folder/operating system and install away!

If you have the Flex Builder 3 public beta installed, you can navigate to the following directory on a Windows system to find the various Flash Player versions (standalone, ActiveX, Mozilla): “C:\Program Files\Adobe\Flex Builder 3\sdks\moxie\runtimes\player\win”. If you don’t have the Flex Builder 3 beta installed, you can download it from “Adobe Labs – Adobe Flex Builder 3 Public Beta”.

These folder names/locations could change with any future beta/nightly build, but I’ll try and keep them updated. If you notice they are no longer correct, leave a message in the comments and I will investigate/reply.

Hopefully that about covers it. Until next time, be safe and happy Flexing!

18 thoughts on “Debugging Flex applications with mm.cfg and flashlog.txt

  1. Hi guys,

    I’m using the flex 2 sdk command line compiler to compile AS3 code that I’m writing in TextPad. I can’t seem to find any file named mm.cfg or logfile.txt on my computer. I would like to be able to use the trace() function and also view runtime errors when they occur. Would anybody know why these files don’t exist?

    Thanks,
    Garret

  2. Just to get things nice and straight…

    mm.cfg will not be created for you. You will have to create the file yourself.

    The definitive location of the log file in Linux is…

    ~/.macromedia/Flash_Player/Logs/flashlog.txt

    Please don’t use /home/$USERNAME$/ since this requires you to define the USERNAME yourself,

    ~/ is always defined as your home folder on a unix/linux system, including Mac Os X.

    On Linux / Unix – you can use..

    tail -f ~/.macromedia/Flash_Player/Logs/flashlog.txt

    Which will view the the progress of the flashlog.txt in a terminal window.

    On Mac Os X use the Console to view the file.

    On Windows, you can get numerous tail-alike programs, Windows 2003 Server Resource kit from Microsoft includes a tail.exe, there’s also Cygwin so you can use unix tail.

  3. By the way, the Windows equivalent to the Unix home alias (e.g. ~/ )

    is %USERPROFILE%

    On XP This points to the Home folder, on Vista this points to the home folder… even though they are named differently.

    From CMD you can

    CD %USERPROFILE%

    To change folder to your home folder…

    or you can…

    ECHO %USERPROFILE%

    to display the home folder….

    So locating the flashlog.txt in Windows is better done as…

    “%USERPROFILE%\Application Data\Macromedia\Flash Player\Logs\flashlog.txt”

    This way you can setup tools for your whole team / interactive department… and that’s nice.

  4. If you are looking for the correct folder under Vista bear in mind that the current user folder is a filofax looking icon and is usually situated just under the desktop icon in windows explorer. I was looking around for ages not realising vista hides this folder while in c:\users\…it isnt seemingly here but it is ! then copy the config file there and something/or the debug player creates this file.

  5. How to install Flash player debugger in linux?

    I already have Flash player. But, in that no Flashlog.txt file…..(No logs folder).

    1. Extra tracers from google downloads or elsewhere are great, but not if you’re working in a corporate environment where additional downloads mean permissions, time and maybe no approval at the end of the day… A native solution gets round all that hassle.

  6. Hey Peter

    I was really wondering, what went wrong even after installing Flash Player Debugger for Firefox, that it is not generating flashlog.txt file.

    But after I followed your steps to update mm.cfg file with following attributes:
    ErrorReportingEnable=1
    TraceOutputFileEnable=1

    This really helped!!!
    Thanks man,
    Great Work :)

    Regards
    Ajit

  7. Hey Everyone,
    I’m on OSX Snow Leopard and the mm.cfg keeps coming up saying:
    ‘Flash Player Debugger config (mm.cfg) file does not exist’
    I have placed in the all the required folders.

    ErrorReportingEnable=1
    TraceOutputFileEnable=1
    SuppressDebuggerExceptionDialogs=1
    PreloadSWF=/Users/*********/Library/Application Support/Firefox/Profiles/o4jydv8q.default/extensions/flashfirebug@o-minds.com/chrome/content/flashfirebug/flashfirebug.swf

    and nothing happens keep coming up with the error
    PLEASE KEEP
    Cheers
    D

Comments are closed.