java.lang.Object
io.jstach.rainbowgum.output.FileOutputBuilder
- All Implemented Interfaces:
LogBuilder<FileOutputBuilder,FileOutput>
public final class FileOutputBuilder
extends Object
implements LogBuilder<FileOutputBuilder,FileOutput>
Builder to create
FileOutput.
Creates file output.
| Property Pattern | Type | Required | Default | Description |
|---|---|---|---|---|
"logging.output.{name}.uri" |
URI |
false |
null |
File uri. |
"logging.output.{name}.fileName" |
String |
false |
null |
File name. |
"logging.output.{name}.append" |
Boolean |
false |
null |
Whether or not to append to existing file. |
"logging.output.{name}.prudent" |
Boolean |
false |
null |
Logback prudent mode where files are locked on each write. |
"logging.output.{name}.bufferSize" |
Integer |
true |
8192 | Buffer size in bytes. |
-
Constructor Summary
ConstructorsConstructorDescriptionFileOutputBuilder(String name) Create a builder forio.jstach.rainbowgum.output.FileOutput. -
Method Summary
Modifier and TypeMethodDescriptionSets append.bufferSize(Integer bufferSize) Sets required bufferSize.build()Createsio.jstach.rainbowgum.output.FileOutputfrom this builder.Sets fileName.fromProperties(LogProperties properties) Will try to convert string key values to parameters needed by the builder.The interpolated property prefix: "logging.output.{name}.".Sets prudent.voidtoProperties(BiConsumer<String, String> consumer) Turns the builder into java.util.Properties like Map skipping values that are null.Sets uri.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jstach.rainbowgum.LogBuilder
fromProperties
-
Constructor Details
-
FileOutputBuilder
Create a builder forio.jstach.rainbowgum.output.FileOutput.- Parameters:
name- will fill{name}inlogging.output.{name}.. Name of output not file name.
-
-
Method Details
-
uri
Sets uri. File uri. Default isnull.- Parameters:
uri-"logging.output.{name}.uri" = java.net.URIFile uri.- Returns:
- this builder.
-
fileName
Sets fileName. File name. Default isnull.- Parameters:
fileName-"logging.output.{name}.fileName" = java.lang.StringFile name.- Returns:
- this builder.
-
append
Sets append. Whether or not to append to existing file. Default isnull.- Parameters:
append-"logging.output.{name}.append" = java.lang.BooleanWhether or not to append to existing file.- Returns:
- this builder.
-
prudent
Sets prudent. Logback prudent mode where files are locked on each write. Default isnull.- Parameters:
prudent-"logging.output.{name}.prudent" = java.lang.BooleanLogback prudent mode where files are locked on each write.- Returns:
- this builder.
-
bufferSize
Sets required bufferSize. Buffer size in bytes. Default is 8192.- Parameters:
bufferSize-"logging.output.{name}.bufferSize" = java.lang.IntegerBuffer size in bytes.- Returns:
- this builder.
-
build
Createsio.jstach.rainbowgum.output.FileOutputfrom this builder.- Returns:
io.jstach.rainbowgum.output.FileOutput.- Throws:
UncheckedIOException- if factory method fails.
-
fromProperties
Description copied from interface:LogBuilderWill try to convert string key values to parameters needed by the builder.- Specified by:
fromPropertiesin interfaceLogBuilder<FileOutputBuilder,FileOutput> - Parameters:
properties- log properties- Returns:
- this.
-
toProperties
Turns the builder into java.util.Properties like Map skipping values that are null.- Parameters:
consumer- apply is called where first arg is key and second is value.
-
propertyPrefix
The interpolated property prefix: "logging.output.{name}.".- Specified by:
propertyPrefixin interfaceLogBuilder<FileOutputBuilder,FileOutput> - Returns:
- resolved prefix which should end with a "
.". - See Also:
-