class WriterBasedReceiver extends Receiver
Implements a Receiver that formats entries with an EntryFormatter and then writes them to a Writer.
The Writer is specified using a writer creation function so that this receiver can recreate the Writer as many
times as it needs to. This may happen if close() is called before the last time receive(Entry) is called.
When receive(Entry) is called after close(), the function is used to recreate the Writer. This functionality
is used to support logrotate integration (or other utilities that would need a log file to be reopened).
- Alphabetic
- By Inheritance
- WriterBasedReceiver
- Receiver
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
WriterBasedReceiver(createWriterFn: ⇒ Writer)(implicit formatter: EntryFormatter = DefaultEntryFormatter)
- createWriterFn
a function that creates the Writer which entries should be written to
- formatter
the formatter used to format the entries before writing them
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
close(): Unit
Closes the receiver.
Closes the receiver. This means that the resources held by this receiver should be released in preparation for it being decommissioned. This usually happens before system shutdown, but it does not necessarily mean that this receiver will not receive any more entries. Receviers can be closed simply to release file system or network resources.
This method must handle any flushing that is required prior to any resource deallocation. Timber will not necessarily call
flush()beforeclose().- Definition Classes
- WriterBasedReceiver → Receiver
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flush(): Unit
Tells this receiver to flush any buffered entries that it has received but not yet fully processed.
Tells this receiver to flush any buffered entries that it has received but not yet fully processed. This makes it possible for this receiver to improve performance by batching I/O work.
- Definition Classes
- WriterBasedReceiver → Receiver
-
def
flushAtLeastEvery(duration: FiniteDuration): Receiver
- Definition Classes
- Receiver
-
def
flushImmediately: Receiver
- Definition Classes
- Receiver
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
receive(entry: Entry): Unit
Receives an Entry for processing.
Receives an Entry for processing. There is no initialization method for receivers, so this method must handle resource initialization on the first call after construction or after closure.
- entry
the entry being received by this receiver
- Definition Classes
- WriterBasedReceiver → Receiver
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withLocking: Receiver
- Definition Classes
- Receiver
-
def
withQueueing: Receiver
- Definition Classes
- Receiver