/RPI-MultiService-Logger-Daemon

POSIX IPC Library for inter-process communication & a Logger Daemon to manage logs for Embedded Linux Applications

Primary LanguageMakefile

IPC Library and Logging System

This project encompasses an IPC Library for inter-process communication, a Logger Daemon to manage logs, Mathematical Operation Applications, and a Logger Receiver Application for local log monitoring. These components collectively facilitate efficient communication and comprehensive logging within the system.

Objective

The IPC Library is designed to facilitate communication between different processes within a system. It provides a set of APIs to handle the creation of message queues, sending and receiving messages, and descriptive error handling. This library will be utilized by various applications that need to communicate with each other in the system.

Additionally, the Logging System aims to centralize and manage log data generated by different applications. It includes a Logger Daemon that writes logs to a file and sends them over Ethernet to an external log collector. Applications will use the IPC Library to send logs to the Logger Daemon for further processing and distribution.

IPC Library

Classes

  1. Receiver Class: This class is intended for use by the receiver application. It handles the creation of message queues and receiving messages. The class offers APIs for both synchronous (blocking) and asynchronous (non-blocking) reception.

  2. Sender Class: The sender application employs this class to connect to an existing message queue created by the receiver. It handles sending messages to the queue and returns an error if the receiver does not exist.

The IPC Library implements descriptive error handling and utilizes a message queue-based communication mechanism.

Logger Daemon Application

Objective

The Logger Daemon serves as a centralized log management system for various applications in the system.

Content

  • Log File: The Logger Daemon utilizes Boost Logger to log monitored applications into a single file. Once the log file reaches a maximum size of 1k lines, a new file is created with a timestamp-based name. Each log entry includes the name of the application that generated it.

  • Daemon Operation: The Logger Daemon operates as a daemon process. Applications use the IPC Library to communicate logs to the daemon via message queues.

  • Ethernet Logging: The Logger Daemon sends logs over Ethernet to an external log collector through TCP/IP. The logs are formatted to include the source application's name.

  • Configuration: The daemon uses a configuration file located in /etc to determine which applications will log through it. The developer defines this configuration in a text format. The configuration file is essential for creating the necessary message queues.

Mathematical Operation Applications

Objective

The Mathematical Operation Applications perform mathematical operations based on command-line arguments provided by the user.

Content

  • Help Manual: The applications include a help manual that is displayed when the user misuses the application or requests it using the --help option.

  • Logging: The applications utilize the IPC Library and Logger Daemon to log relevant information. To use the Logger Daemon, they must be added to the configuration file of the daemon.

Logger Receiver Application

Objective

The Logger Receiver Application operates on a local machine, receiving logs from hardware via Ethernet and displaying them on the console.

Content

  • Operation: The application is a native program that communicates with the Logger Daemon on the board using TCP/IP.

  • Log Reception: The application receives logs from the daemon and displays them on the console for monitoring and analysis.