Presentation is loading. Please wait.

Presentation is loading. Please wait.

LogBox Enterprise Logging Brad Wood

Similar presentations


Presentation on theme: "LogBox Enterprise Logging Brad Wood"— 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 SeverityInteger Level FATAL 0 (Default LevelMin) ERROR 1 WARN 2 INFO 3 DEBUG 4 (Default LevelMax)

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

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: w iki.coldbox.org/wiki/LogBox.cfm Website: http://www.coldbox.org/


Download ppt "LogBox Enterprise Logging Brad Wood"

Similar presentations


Ads by Google