flex_logger_file 1.0.4 copy "flex_logger_file: ^1.0.4" to clipboard
flex_logger_file: ^1.0.4 copied to clipboard

File logging provider for FlexLogger - writes logs to local files with rotation support

1.0.4 #

  • Updated dependencies (intl: ^0.20.2, flex_logger: ^1.0.4).

1.0.3 #

  • Added optional dateFormat parameter to FileFormatter, SingleFileStrategy, and FileLoggerProvider.singleFile().
  • Added providerId parameter to rotating() and timeBased() factory constructors.
  • SingleFileStrategy cleanup uses streaming I/O for better memory efficiency.
  • dispose() in all strategies now awaits in-progress operations before teardown.
  • Improved error recovery in TimeBasedFileStrategy file switches.
  • Re-exported DateFormat from barrel file.

1.0.1 #

  • FileFormatter output is now pipe-separated with fixed-width level columns; error and critical entries are wrapped in separator lines.
  • SingleFileStrategy and RotatingFileStrategy now use utf8.encode for accurate byte-count tracking instead of String.length.
  • Breaking: RotatingFileStrategy removed directoryPath and fileName constructor parameters — use filePath instead.
  • Breaking: FileObserver removed logFilePath getter and watchLogFile() method — use the strategy's watchLogFile() directly.
  • SingleFileStrategy removed the internal FileSystemEvent watcher; cleanup is now triggered only by write frequency.
  • FileObserver callbacks (onLog, onException, onError) updated to Future<void> to match FlexObserver changes.
  • TimeBasedFileStrategy uses path.join for file path construction.

1.0.0 #

  • Initial release
  • FileLoggerProvider implementing LoggerProvider: default constructor with custom FileStrategy; factory constructors singleFile, rotating, timeBased; optional formatter, filter, providerId.
  • FileObserver (FlexObserver): writes logs via FileStrategy; initialize(), dispose().
  • FileFormatter implementing LogFormatter: format [YYYY-MM-DD HH:MM:SS.mmm] [LEVEL] message; error and stack trace (stack trace abbreviated if > 1000 chars).
  • FileStrategy (abstract): initialize(), write(String), dispose(), currentLogFilePath.
  • SingleFileStrategy: single file; filePath?; optional maxFileSize, maxAge, cleanupCheckInterval; buffers during cleanup; timestamp-based line filtering for age/size; default path <documents>/app.log.
  • RotatingFileStrategy: size-based rotation; filePath?; maxFileSize (default 10 MB), maxBackupCount (default 5); current file renamed to .1, .2, …; buffers during rotation; no logs lost; default path <documents>/app.log.
  • TimeBasedFileStrategy: one file per day; directoryPath?, fileNamePattern ({prefix}, {date}), filePrefix; optional maxAge, maxFiles; buffers during file switch.
  • Optional per-provider filter (e.g. MinLevelFilter); default AcceptAllFilter.
  • Auto creation of log directories by all strategies.
0
likes
160
points
279
downloads

Publisher

verified publisherkrajna.dev

Weekly Downloads

File logging provider for FlexLogger - writes logs to local files with rotation support

Homepage
Repository (GitLab)
View/report issues

Topics

#logging #file-logging #persistence #log-rotation

Documentation

API reference

License

MIT (license)

Dependencies

flex_logger, flutter, intl, path, path_provider

More

Packages that depend on flex_logger_file