LoggerBuilder class

Constructors

LoggerBuilder()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAppender(Appender appender) LoggerBuilder
Adds a pre-built appender instance to the configuration. This is useful for custom appenders or those created programmatically using the AppenderBuilder.
addAppenderConfig(Map<String, dynamic> config) LoggerBuilder
Needed by extensions
addToExisting() LoggerBuilder
Add to existing appenders (default behavior)
build({bool test = false, DateTime? date}) Future<void>
Build and initialize the logger asynchronously By default, ADDS to existing appenders. Use replaceAll() to replace them.
buildSync() → void
Build synchronously (only works with console appenders and replace mode)
console({Level level = Level.INFO, String format = '%d %l %m', String dateFormat = 'HH:mm:ss.SSS', bool devtools = false}) LoggerBuilder
Add a console appender
file({required String filePattern, Level level = Level.DEBUG, String format = '%d [%l][%t] %c - %m [%f]', String dateFormat = 'yyyy-MM-dd HH:mm:ss.SSS', String fileExtension = 'log', String rotationCycle = 'DAY', String path = '', bool clearOnStartup = false}) LoggerBuilder
Add a file appender
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceAll() LoggerBuilder
Replace all existing appenders with the ones from this builder
toString() String
A string representation of this object.
inherited
withAppVersion(String appVersion) LoggerBuilder
Set app version
withMdcValue(String key, String value) LoggerBuilder
Add a custom MDC value
withRootLevel(Level level) LoggerBuilder
Sets the root logging level for the entire configuration. This acts as a global filter before messages reach individual appenders. Defaults to INFO.
withSelfDebug([Level level = Level.DEBUG]) LoggerBuilder
Enable self-debugging

Operators

operator ==(Object other) bool
The equality operator.
inherited