1 / 15

LogBox

LogBox. Enterprise Logging. Brad Wood www.codersrevolution.com brad@bradwood.com. What is LogBox?. LogBox is an enterprise ColdFusion logging library designed to give you flexibility, simplicity and power when logging or tracing is needed in your applications.

sflournoy
Download Presentation

LogBox

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LogBox Enterprise Logging Brad Wood www.codersrevolution.com brad@bradwood.com

  2. What is LogBox? • LogBox is an enterprise ColdFusion logging library designed to give you flexibility, simplicity and power when logging or tracing is needed in your applications. • Inspired by Log4J (A Java logger made by Apache) • LogBox is part of the ColdBox Platform 3.0 or can be used as a stand-alone logging library.

  3. Message Severities

  4. Where Do I Use It? Log messages can come from anywhere in your application. • Logs from the framework (coldbox.system) • Specific component (com.example.order.orderService) • Package (com.example.security) • Ad-hoc locations (“nightly-scheduled-task”)

  5. Where Do The Messages Go? Messages can be sent to any combination of appenders. LogBox ships with 14 appenders! • Files • Asynch files • Emails • Databases • Java sockets • Twitter • Web Services

  6. Custom Logging Levels • Turn debugging of certain services on only when you need it (WireBox debugging) • Log information or debug messages only on dev server, but not in production • Only store logs from certain parts of your framework

  7. Extending LogBox • Create custom appenders • Create custom layouts • Empower your CFC’s to create their own string representations for logging purposes.

  8. Getting Started The minimum you need to get started: • Define root logger • Configure at least one appender • That’s it!

  9. 3 Ways To Configure LogBox • Configuration CFC (my favorite) • XML Config • Programmatic Config

  10. Configuration CFC function configure(){ logBox = { // Define Appenders appenders = { coldboxTracer = { class=“path.to.appender" } }, // Root Logger root = { levelmax="INFO", levelMin=0, appenders="*" } }; }

  11. XML Config <LogBox> <!-- Appender Definitions --> <Appender name="myconsole" class="path.to.appender" /> <!-- Root Logger --> <root levelMin="0" levelMax="4" appenders="*"> </LogBox>

  12. Programmatic Config // Configuring some appenders and the root logger config.appender( name="Console", class="path.to.appender"); // root logger config.root( levelMin=config.logLevels.FATAL, levelMax=config.logLevels.INFO, appenders="Console");

  13. Code Examples Base Functionality • Simple LogBox in a non-ColdBox app • Simple LogBox in a ColdBox app • Configure different logging levels • Configure different logging levels per environment • Configure multiple appenders • Configure multiple categories

  14. Code Examples Customizing/extending LogBox • Write custom layout • Extra Info examples • Write custom appender

  15. Questions? • Brad Wood • www.codersrevolution.com • brad@bradwood.com • Mailing List: groups.google.com/group/coldbox • Docs: wiki.coldbox.org/wiki/LogBox.cfm • Website: http://www.coldbox.org/

More Related