|
|
| DobbyLogger (const std::shared_ptr< const IDobbySettings > &settings) |
| |
| bool | StartContainerLogging (std::string containerId, pid_t runtimePid, pid_t containerPid, std::shared_ptr< IDobbyRdkLoggingPlugin > loggingPlugin) |
| | Public method that should be called once a container has been created to match the container PID with the runtime PID to start running the logging thread based on whichever logging plugin is loaded.
|
| |
| bool | DumpBuffer (int bufferMemFd, pid_t containerPid, std::shared_ptr< IDobbyRdkLoggingPlugin > loggingPlugin) |
| | Blocking method that writes the contents of a buffer at a given memFd to the logger specified in the container config.
|
| |
|
|
int | createDgramSocket (const std::string &path) |
| |
| int | createUnixSocket (const std::string path) |
| | Create a new UNIX domain socket that the OCI runtime can connect to and send the fd of the ptty used for the container.
|
| |
| int | receiveFdFromSocket (const int connectionFd) |
| | Once a connection to the socket has been made, wait to receive a message that contains a file descriptor.
|
| |
| void | connectionMonitorThread (const int socketFd) |
| | Runs for the lifetime of the daemon, waiting for new connections to the socket. Once a connection is received, add to the map.
|
| |
|
void | closeAndDeleteSocket (const int fd, const std::string &path) |
| | Closes and deletes a socket at a given fd/path.
|
| |
|
|
std::mutex | mLock |
| |
|
int | mSocketFd |
| |
|
const std::string | mSocketPath |
| |
|
const std::string | mSyslogSocketPath |
| |
|
const std::string | mJournaldSocketPath |
| |
|
std::map< pid_t, int > | mTempFds |
| |
|
std::shared_ptr< AICommon::PollLoop > | mPollLoop |
| |
|
std::shared_ptr< DobbyLogRelay > | mSyslogRelay |
| |
|
std::shared_ptr< DobbyLogRelay > | mJournaldRelay |
| |
◆ connectionMonitorThread()
| void DobbyLogger::connectionMonitorThread |
( |
const int |
socketFd | ) |
|
|
private |
Runs for the lifetime of the daemon, waiting for new connections to the socket. Once a connection is received, add to the map.
- Parameters
-
| [in] | socketFd | FD of the socket passed to the runtime –console-socket param |
◆ createUnixSocket()
| int DobbyLogger::createUnixSocket |
( |
const std::string |
path | ) |
|
|
private |
Create a new UNIX domain socket that the OCI runtime can connect to and send the fd of the ptty used for the container.
- Parameters
-
| [in] | path | Where to create the socket |
◆ DumpBuffer()
| bool DobbyLogger::DumpBuffer |
( |
int |
bufferMemFd, |
|
|
pid_t |
containerPid, |
|
|
std::shared_ptr< IDobbyRdkLoggingPlugin > |
loggingPlugin |
|
) |
| |
Blocking method that writes the contents of a buffer at a given memFd to the logger specified in the container config.
Mainly used for writing the contents of the OCI hooks stdout/err to the container logfile
- Parameters
-
| [in] | bufferMemFd | fd of the buffer |
| [in] | containerPid | PID of the container the logs belong to |
| [in] | loggingPluing | The logging plugin the contents of the buffer should be sent to |
◆ receiveFdFromSocket()
| int DobbyLogger::receiveFdFromSocket |
( |
const int |
connectionFd | ) |
|
|
private |
Once a connection to the socket has been made, wait to receive a message that contains a file descriptor.
- Parameters
-
| [in] | connectionFd | fd of the connection to the Dobby logging socket |
◆ StartContainerLogging()
| bool DobbyLogger::StartContainerLogging |
( |
std::string |
containerId, |
|
|
pid_t |
runtimePid, |
|
|
pid_t |
containerPid, |
|
|
std::shared_ptr< IDobbyRdkLoggingPlugin > |
loggingPlugin |
|
) |
| |
Public method that should be called once a container has been created to match the container PID with the runtime PID to start running the logging thread based on whichever logging plugin is loaded.
- Parameters
-
| [in] | containerId | Name of the container |
| [in] | runtimePid | PID of the OCI runtime that connected to the socket |
| [in] | containerPid | PID of the running container |
| [in] | loggingPlugin | Plugin that will process the container logs |
- Returns
- True if thread started successfully
The documentation for this class was generated from the following files:
- daemon/lib/source/include/DobbyLogger.h
- daemon/lib/source/DobbyLogger.cpp