logger property
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 operationsDEBUG: Configuration steps and lifecycle transitionsINFO: Major lifecycle events (setup, start, stop)WARN: Non-critical issues and deprecationsERROR: 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);