Qore logger_bin Module 2.1.1
Loading...
Searching...
No Matches
Qore::Logger::LoggerAppenderFile Class Reference

Implements appender writing to a file. More...

#include <QC_LoggerAppenderFile.dox.h>

Inheritance diagram for Qore::Logger::LoggerAppenderFile:
Qore::Logger::LoggerAppenderWithLayout Qore::Logger::LoggerAppender

Public Member Methods

 closeFile ()
 Closes the file.
 
 constructor (*string name, LoggerLayout layout, string filename, *string encoding)
 Creates the appender with the supplied arguments.
 
 constructor (LoggerLayout layout, string filename, *string encoding)
 Creates the appender with the supplied arguments.
 
File getFile ()
 Returns the file object for the appender.
 
string getFileName ()
 Returns the current filename.
 
 openFile ()
 Opens the file.
 
 processEventImpl (int type, auto params)
 Processes open, close, and log events with the file and ignores all other events.
 
 reopen ()
 Reopens the file atomically.
 
- Public Member Methods inherited from Qore::Logger::LoggerAppenderWithLayout
 constructor (LoggerLayout layout)
 Creates the object.
 
 constructor (*string name, LoggerLayout layout)
 Creates the object.
 
LoggerLayout getLayout ()
 Returns the layout for the appender.
 
 setLayout (LoggerLayout layout)
 Assigns a layout to the appender.
 
- Public Member Methods inherited from Qore::Logger::LoggerAppender
 addFilter (LoggerFilter filter, bool top=False)
 Adds a filter to the chain.
 
 close ()
 Releases any resources allocated by the appender and closes it.
 
 constructor ()
 Creates the object.
 
 constructor (string name)
 Creates the object.
 
list< LoggerFiltergetFilters ()
 Returns the filter chain as a list.
 
string getName ()
 Returns the appender name.
 
*LoggerAppenderQueue getQueue ()
 Returns async queue or nothing when events are processed synchronously.
 
bool isOpen ()
 Returns True if the appender is open and therefore active.
 
 open ()
 Opens logging resources.
 
bool post (LoggerEvent event)
 Posts the given event to the output queue.
 
 processEvent (int type, auto params)
 Processes an event to the physical target.
 
abstract processEventImpl (int type, auto params)
 Processes the event to the physical target.
 
 removeAllFilters ()
 Clears the filter chain by removing all filters.
 
 removeFilter (LoggerFilter filter)
 Removes the given filter from the filter chain.
 
 setQueue (*LoggerAppenderQueue queue)
 Sets the appender queue.
 

Static Public Member Methods

static closeFileStatic (File file)
 Closes the given file, ignores errors related to unclosable files.
 

Additional Inherited Members

- Private Member Methods inherited from Qore::Logger::LoggerAppenderWithLayout
auto serializeImpl (LoggerEvent event)
 Serializes the given event to put in the queue or write to the target device.
 
- Private Member Methods inherited from Qore::Logger::LoggerAppender
*object ensureAtomicOperations (int type)
 Returns an object that can be used to ensure atomic operations for appender operations.
 
bool pushEvent (int type, auto params)
 Pushes the given event on the queue or calls processEvent() in case of synchronous processing.
 
abstract auto serializeImpl (LoggerEvent event)
 Serializes the given event to put in the queue or write to the target device.
 

Detailed Description

Implements appender writing to a file.

No multi-threading protection is implemented in the class; the File class is reused

Member Function Documentation

◆ constructor() [1/2]

Qore::Logger::LoggerAppenderFile::constructor ( *string  name,
LoggerLayout  layout,
string  filename,
*string  encoding 
)

Creates the appender with the supplied arguments.

Parameters
namethe name of the appender
layoutthe layout for the appender
filenamethe output filename
encodingthe file's output encoding

◆ constructor() [2/2]

Qore::Logger::LoggerAppenderFile::constructor ( LoggerLayout  layout,
string  filename,
*string  encoding 
)

Creates the appender with the supplied arguments.

Parameters
layoutthe layout for the appender
filenamethe output filename
encodingthe file's output encoding

◆ processEventImpl()

Qore::Logger::LoggerAppenderFile::processEventImpl ( int  type,
auto  params 
)

Processes open, close, and log events with the file and ignores all other events.

Parameters
typethe event type
paramsparameters for the event

The documentation for this class was generated from the following file: