Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ITB2019 CacheBox + LogBox 101 - Brad Wood


Published on

Two of the most underused libraries are LogBox and CacheBox. The biggest feature they offer is abstraction. You can decouple your app's code from a specific logging or caching mechanism so you can change it out in the future with no big changes to your app. LogBox and CacheBox come bundled with ColdBox but can also be used directly in a legacy codebase as well. In this session we'll demystify some of the basic settings and usage of these powerful libraries to get you up and running and familiar with some of the many options they come with.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ITB2019 CacheBox + LogBox 101 - Brad Wood

  1. 1. Introduction to CacheBox 101 --& -- LogBox 101 Brad Wood @bdw429s
  2. 2. Who Am I? ● ColdFusion Architect (12 years) ● Geek ● Android Lover ● Blogger ( ● ColdBox Platform Evangelist ● Musician ● Shade-Tree Mechanic ● Husband (16 years) ● Dad (3 beautiful girls)
  3. 3. What is Caching?
  4. 4. What is CachBox? CacheBox is an enterprise caching engine, aggregator, and API for ColdFusion applications.
  5. 5. Where can it be used? It is part of the ColdBox Platform but it can also function on its own as a standalone framework.
  6. 6. What is a Cache Aggregator? ● Ability to aggregate different caching engines ● Ability to aggregate different configurations of the same caches ● Consistent API for all caches ● Swap out backend caching implementation
  7. 7. What is a Cache Aggregator?
  8. 8. Features ● No need to create it, configure it or manage it if used within a ColdBox Application ● Multi-Threaded ● Based on Java Concurrency Classes ● Memory Management & Memory Sensitive caching based on Java Soft References ● Multiple Eviction Policies: LRU, LFU and FIFO ● High Load Tested ● Fully Documented
  9. 9. Highly Configurable ● JVM Threshold Checks ● Object count limits ● Objects time based expirations ● Purging based on object usage (Access Timeouts)
  10. 10. Visually Appealing and Useful
  11. 11. What Caches are Supported? ● CF Provider (EHCache) ● Lucee Provider ● In-memory Provider (CacheBox) ● Couchbase ● Redis ● Memcached ● Disk Store ● DB Store (JDBC)
  12. 12. Basic API Cache Operations ● get(key) ● set(key,value) ● lookup(key) ● clear(key) ● getOrSet( key, UDF )
  13. 13. ColdBox View Caching <coldbox.cfc> coldbox.viewCaching = true; event.setView(name='home',cache=true,cacheTimeout=30); <cfoutput> #renderView(view='tags/footer',cache=true,cacheTimeout="60")# </cfoutput> event.setView( name='home', cache=true, cacheTimeout=30, cacheSuffix=rc.language);
  14. 14. ColdBox Event Caching <coldbox.cfc> coldbox.eventCaching = true; function showEntry(event,rc,prc) cache="true" cacheTimeout="30" { //get Entry prc.entry = getEntryService().getEntry(); //set view event.setView('blog/showEntry'); }
  15. 15. CacheBox Questions
  16. 16. What is LogBox? ● LogBox is an enterprise ColdFusion logging library ● Inspired by Log4J (A Java logger made by Apache) ● LogBox is part of ColdBox or can be used as a stand-alone logging library.
  17. 17. Message Severities 4 (Default LevelMax)DEBUG 3INFO 2WARN 1ERROR 0 (Default LevelMin)FATAL Integer LevelSeverity
  18. 18. 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 ( ● Ad-hoc locations (“nightly-scheduled-task”)
  19. 19. Where Do The Messages Go? ● Files (async) ● Emails ● Databases ● BuglogHQ ● Sentry ● Rollbar ● ● Slack ● Pingdom
  20. 20. 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
  21. 21. LogBox Questions