logger property

  1. @protected
Log get logger

The logger associated with this application context.

Subclasses should use this logger for all logging activities related to context lifecycle, configuration, and operations.

Logging Levels:

  • TRACE: Detailed internal operations
  • DEBUG: Configuration steps and lifecycle transitions
  • INFO: Major lifecycle events (setup, start, stop)
  • WARN: Non-critical issues and deprecations
  • ERROR: Critical failures and exceptions

Example:

@override
Future<void> setup() async {
  logger.debug('Starting context setup...');
  try {
    await super.setup();
    logger.info('Context setup successfully');
  } catch (e) {
    logger.error('Context setup failed', error: e);
    rethrow;
  }
}

Implementation

@protected
Log get logger => LogFactory.getLog(runtimeType);