LogoLogo
InstallSource CodeIssuesSupport
v1.x
v1.x
  • Introduction
  • Essentials
    • Installation
    • Configuration
    • Creating Components
    • Rendering Views
    • Data Properties
    • Actions
    • Events
    • Lifecycle Events
  • Component Features
    • Redirecting
    • Logging
  • Templates
    • Loading States
    • Polling
    • Prefetching
    • Offline State
    • Dirty States
    • Defer Loading
  • JS Integrations
    • AlpineJS
    • Inline Scripts
  • Testing
  • Security
  • Troubleshooting
  • CommandBox Commands
Powered by GitBook
On this page

Was this helpful?

  1. Component Features

Logging

PreviousRedirectingNextLoading States

Last updated 3 years ago

Was this helpful?

We inject a logger into all cbwire Components to provide you with built-in logging.

component extends="cbwire.models.Component"{

    function mount(){
        log.info( "mount() called" );
    }

    function someAction(){
        log.debug( "someAction() called" );
    }

}

You can also access the LogBox parent object using getLogBox().

component extends="cbwire.models.Component"{

    function mount(){
        var logbox = getLogBox();
        var logger = logbox.getRootLogger();
        log.info( "Logging with the root logger!" );
    }

}
LogBox