Debugging Flex applications with mm.cfg and flashlog.txt

by Peter deHaan on August 26, 2007

in Debugging, Flex 3 SDK

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!

{ 10 comments… read them below or add one }

1 Charly August 27, 2007 at 3:14 am

But on my OSX 10.4.9 it’s in the Path: MacHD:Users:username

greets

Reply

2 Elango August 27, 2007 at 3:26 am

Firefox has FlashTracer addon which will show the trace output as a seperate panel when configuring flashlog.txt path in the FlashTracer option.

https://addons.mozilla.org/en-US/firefox/addon/3469

Thanks

Reply

3 julien September 30, 2007 at 7:11 am

Hi, for linux it’s /home/USERNAME/.macromedia/Flash_Player/Logs/flashlog.txt

:)
Cheers

Reply

4 Garret October 11, 2007 at 2:21 pm

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

Reply

5 JasonM March 10, 2008 at 2:33 pm

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.

Reply

6 JasonM March 10, 2008 at 2:39 pm

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.

Reply

7 peterd March 10, 2008 at 4:21 pm

JasonM,

That is awesome, thanks for the feedback!

Peter

Reply

8 Bora Nikolic April 17, 2008 at 8:41 pm

I’ve had mm.cfg and flashlog.txt stop working after upgrading to a new version of the Flash Debug Player (9.0.124.0) on Mac OS X (Intel) – Hope my post helps someone, have a look here: http://www.boranikolic.com/blog/2008/04/17/flash-player-debug-version-problems-in-os-x-demystified/

Reply

9 calvin June 25, 2008 at 6:58 am

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.

Reply

10 JasonM October 15, 2008 at 10:33 pm

No problem Peter, happy to add some goodness. ;)

Reply

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: