O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 74. The Logging Framework

Flex includes a simple yet versatile logging framework that can be used for gathering diagnostic information while an application is running, and for reporting errors in deployed applications. This chapter begins by introducing the Flex logging framework and explaining how to use its main features, before moving on to look at customization, and then finishing with an assortment of further tips and tricks on the subject of logging.

Overview

Incorporating log statements into an application is preferable to using the global trace function, since log statements can be categorized and filtered based on their source and level of severity. Logs can also be targeted to different places, from the Flash log file or Flex Builder console to a remote Web Service. There are many ways to use logging, from the simple recording of diagnostic information that helps with debugging to creating detailed audit trails of the way a user interacts with an application.

This chapter begins by covering the basic logging framework classes and interfaces that are included with the Flex SDK. It explains how to create and configure a logger, issue log statements with different levels of severity, and apply filters. The second part of the chapter covers customizing the logging framework to send log statements to a remote server. The chapter ends with a collection of further tips, including some on logging to Firebug and removing log statements from production code.

To complement this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required