|
| FileSink (const std::string &containerId, std::shared_ptr< rt_dobby_schema > &containerConfig) |
| A logging sink that sends the contents of the container stdout/err to a given file. The file can have a size limit set.
|
|
void | DumpLog (const int bufferFd) override |
| Reads all the available data from the provided fd and writes it to the output file. Does not attempt to seek the file descriptor back to the start.
|
|
void | process (const std::shared_ptr< AICommon::IPollLoop > &pollLoop, epoll_event event) override |
| Called by the pollLoop when an event occurs on the container ptty.
|
|
|
int | openFile (const std::string &pathName) |
| Opens the log file at a given path. Will create a new file when called, and subsequent writes will append to the file.
|
|
|
const std::shared_ptr< rt_dobby_schema > | mContainerConfig |
|
const std::string | mContainerId |
|
ssize_t | mFileSizeLimit |
|
std::string | mOutputFilePath |
|
int | mOutputFileFd |
|
int | mDevNullFd |
|
bool | mLimitHit |
|
char | mBuf [PTY_BUFFER_SIZE] |
|
std::mutex | mLock |
|
◆ FileSink()
FileSink::FileSink |
( |
const std::string & |
containerId, |
|
|
std::shared_ptr< rt_dobby_schema > & |
containerConfig |
|
) |
| |
A logging sink that sends the contents of the container stdout/err to a given file. The file can have a size limit set.
Will create the requested file providing the directory exists. Creates a new file each time this class is instantiated
◆ DumpLog()
void FileSink::DumpLog |
( |
const int |
bufferFd | ) |
|
|
overridevirtual |
Reads all the available data from the provided fd and writes it to the output file. Does not attempt to seek the file descriptor back to the start.
If file limit is hit, will send data to /dev/null
- Parameters
-
[in] | bufferFd | The fd to read from |
Implements ILoggingSink.
◆ openFile()
int FileSink::openFile |
( |
const std::string & |
pathName | ) |
|
|
private |
Opens the log file at a given path. Will create a new file when called, and subsequent writes will append to the file.
- Parameters
-
[in] | pathName | Where to create the file |
- Returns
- Opened file descriptor
◆ process()
void FileSink::process |
( |
const std::shared_ptr< AICommon::IPollLoop > & |
pollLoop, |
|
|
epoll_event |
event |
|
) |
| |
|
overridevirtual |
Called by the pollLoop when an event occurs on the container ptty.
Reads the contents of the ptty and logs to a file
Implements AICommon::IPollSource.
The documentation for this class was generated from the following files:
- rdkPlugins/Logging/source/FileSink.h
- rdkPlugins/Logging/source/FileSink.cpp