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 ...

Get Professional Adobe® Flex® 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.