FileAppender class
A log file, which the web cannot have: this version keeps the API of the real one so code compiles everywhere, but its constructor throws.
Check isSupported before creating one. The starter does: on the web
it ignores logging.file.* with a warning.
- Inheritance
-
- Object
- LogAppender
- FileAppender
Constructors
- FileAppender(String path, {LogPattern? pattern, int maxFileSize = 10 * 1024 * 1024, int maxHistory = 7, int totalSizeCap = 0, bool cleanHistoryOnStart = false, Encoding encoding = utf8, SpringLogLevel threshold = SpringLogLevel.trace})
- Always throws an UnsupportedError: there is no file system here.
Properties
- encoding → Encoding
-
The charset the lines are written in (
logging.charset.file, UTF-8 by default).final - hashCode → int
-
The hash code for this object.
no setterinherited
- isFailing → bool
-
Always
false: there is no file here.no setter - maxFileSize → int
-
The size in bytes that starts a new file;
0never rolls over.final - maxHistory → int
-
How many rolled-over files are kept;
0keeps all of them.final - path → String
-
The location of the log file, as given to the constructor.
final
- pattern ↔ LogPattern
-
How a record becomes a line.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- threshold ↔ SpringLogLevel
-
The lowest level this appender writes, checked after the logger
levels; SpringLogLevel.off writes nothing.
getter/setter pairinherited
- totalSizeCap → int
-
The most bytes the rolled-over files may take together;
0sets no limit.final
Methods
-
append(
SpringLogRecord record) → void -
Called by the logging system for each record: passes it to write
when it is at or above threshold, and drops it otherwise.
inherited
-
close(
) → void -
Releases what the appender holds, such as an open file. Called by
LoggingSystem.removeAppender; does nothing by default.inherited -
flush(
) → void - Does nothing: nothing is ever buffered here.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
SpringLogRecord record) → void -
Writes
recordto this output. Implement it in a subclass; the record has already passed threshold. It runs synchronously on the logging call, so slow work (a network call) should be queued.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- isSupported → const bool
-
Whether log files can be written on this platform: always
falsehere.