Sarfraz Ahmed
Sarfraz Ahmed

Reputation: 1399

Create and view Flash Log

I want to create log file for my flex application. That is the file should contain all the trace prints in it when I run my flex application. How can I configure flex to do this? thanks

Upvotes: 0

Views: 1152

Answers (3)

nMoncho
nMoncho

Reputation: 370

I suggest that you take a look at: http://www.as3commons.org/as3-commons-logging/index.html Thats a library very similar to Log4j, I personally implemented a appender for AMF logging.

If you read the user guide http://www.as3commons.org/as3-commons-logging/userguide.html you'll see that it's very easy to log everything (and if you have Flash player 10 you could even log uncatched errors). The only downside is that with the normal flash player (not the debugger version) you can't get the stack trace.

Hope it helps

Upvotes: 1

Mike Petty
Mike Petty

Reputation: 949

That partly depends on where / how you want the log file to be accessible. If it's only something you / the development team is concerned about - esp in remote debugging scenarios, then a secondary tool which does the above should be sufficient.

However, if this is something that you want to see running in the app as a user, then you need to get a little more creative and try using the Logger class. It differentiates each log event by priority and has the ability to create an implementation - one of which is the trace logger. However the logger api still needs to be followed, and this means refactoring the actual trace statement itself to point to the logger instance.

Upvotes: 2

Sunil D.
Sunil D.

Reputation: 18194

With the debug Flash Player, you can write your trace statements to disk by editing/creating the mm.cfg file.

Upvotes: 3

Related Questions