This class implements the Observer protocol. The publish method of this class outputs the log records that it receives to a user‐specified file. This class is thread‐safe; different threads can operate on an object concurrently. This class is exception‐neutral with no guarantee of rollback. In no event is memory leaked.
Synopsis
Declared in <ball_fileobserver2.h>
class FileObserver2
: public Observer
Base Classes
Name |
Description |
This class provides a protocol for receiving and processing log record output. |
Type Aliases
Name |
Description |
|
|
|
|
|
Member Functions
Name |
Description |
|
Create a file observer with file logging initially disabled. Optionally specify a |
|
Close the log file of this file observer if file logging is enabled, and destroy this file observer. |
Disable file logging for this file observer. This method has no effect if file logging is not enabled. Note that records subsequently received through the |
|
Disable log file rotation based on a periodic time interval for this file observer. This method has no effect if rotation‐on‐time‐interval is not enabled. |
|
Disable publishing of the timestamp attribute of records in local time by this file observer; henceforth, timestamps will be in UTC time. This method has no effect if publishing in local time is not enabled. Note that this method also affects log filenames (see {Log Filename Patterns}). |
|
Disable log file rotation based on log file size for this file observer. This method has no effect if rotation‐on‐size is not enabled. |
|
Disable log file rotation based on a periodic time interval for this file observer. This method has no effect if rotation‐on‐time‐interval is not enabled. |
|
|
|
Enable publishing of the timestamp attribute of records in local time by this file observer. This method has no effect if publishing in local time is already enabled. Note that this method also affects log filenames (see {Log Filename Patterns}). |
|
Forcefully perform a log file rotation by this file observer. Close the current log file, rename the log file if necessary, and open a new log file. This method has no effect if file logging is not enabled. See {Rotated File Naming} for details on filenames of rotated log files. |
|
Return the format config of the last successful |
|
|
|
Return |
|
Return |
|
Return the difference between the local time and UTC time in effect when this file observer was constructed. Note that this value remains unchanged during the lifetime of this object and therefore may become incorrect when the difference between the local time and UTC time changes (e.g., when transitioning into or out of daylight savings time). |
|
|
|
|
Discard any shared references to |
Set this file observer to perform a periodic log file rotation at multiples of the specified |
|
Set this file observer to perform log file rotation when the size of the file exceeds the specified |
|
|
|
Return the lifetime of the log file that will trigger a file rotation by this file observer if rotation‐on‐lifetime is in effect, and a 0 time interval otherwise. |
|
Return the size (in kilobytes) of the log file that will trigger a file rotation by this file observer if rotation‐on‐size is in effect, and 0 otherwise. |
|
Set the formatting functor used when writing records to the log file of this file observer to a log file functor created according to the specified, possibly URI‐like scheme tagged, |
|
Set the formatting functor used when writing records to the log file of this file observer to the specified |
|
Set the specified |
|
Suppress generating a unique log file name upon rotation if the specified |
|
|
Declare that this type uses a |
Created with MrDocs