|
Java™ by example!
|
|
|
How do I use the MemoryHandler?
A MemoryHandler keeps track of a buffer of LogRecords in memory and will pass them on to another handler when a certain PushLevel is triggered. The following example creates a MemoryHandler that keeps track of maximum 5 LogRecords and writes to a ConsoleHandler when an error occurs that is equal or more "dangerous" than Level.WARNING.
Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|