This directory contains the source code for the AREG Log Collector (logcollector
) application, a robust tool for collecting logs from multiple processes across a network. The logcollector
can operate as either a console application or an OS-managed service. As a key logging and debugging component of the AREG SDK, it is built alongside other SDK sources and can also be used independently for centralized log collection and application behavior analysis.
-
app Contains initialization code for running the
logcollector
as a console application or an OS-managed service. -
service Implements communication with connected clients, such as log sources or observers, to receive and forward log messages.
-
resources Includes resources specific to the
logcollector
application.
The implementation differs between Win32
and POSIX
systems, but all components maintain consistent behavior across platforms. Header files in private
subdirectories are for internal use only and should not be included in external projects.
To configure and run the logcollector
application as a Linux-managed service, follow these steps:
-
Copy Service Configuration File:
- Copy the
logcollector.service
file to the/etc/systemd/system/
directory.
- Copy the
-
Copy the Executable:
- Copy the built
logcollector.elf
executable to the desired location, such as/usr/local/bin
.
- Copy the built
-
Ensure Library Access (if applicable):
- If the AREG Framework was built as a shared library, ensure that
logcollector
has access to thelibareg.so
library (e.g., located in/usr/lib
).
- If the AREG Framework was built as a shared library, ensure that
-
Edit the Service Configuration:
- Open the
logcollector.service
file and verify that theExecStart
path points to the correct location of thelogcollector.elf
executable. For example:ExecStart=/usr/local/bin/logcollector.elf --service
- Ensure the
ExecStart
line includes the--service
(or-s
) as a command line option.
- Open the
-
Enable and Start the Service:
- Enable the service to start automatically at boot:
sudo systemctl enable logcollector.service
- Start the service:
sudo systemctl start logcollector.service
- Enable the service to start automatically at boot:
-
Stop or Disable the Service:
- To stop the service:
sudo systemctl stop logcollector.service
- To disable the service from starting at boot:
sudo systemctl disable logcollector.service
- To stop the service:
To configure and run the logcollector
application as a Windows-managed service, follow these steps:
-
Copy the Binaries:
- Copy the
logcollector.exe
andareg.dll
binaries to the desired location.
- Copy the
-
Install the Service:
- Open PowerShell as the Administrator.
- Register the executable as a service by running:
.\logcollector.exe --install
-
Start the Service:
- Open the Services application (or run
services.msc
in the Command Prompt). - Locate the service named AREG Log Collector Service.
- Start the service by right-clicking it and selecting Start.
- Open the Services application (or run
-
Stop and Uninstall the Service:
- Stop the service using the Services application or the
services.msc
command. - Uninstall the service by running the following command in PowerShell:
.\logcollector.exe --uninstall
- Stop the service using the Services application or the
The logcollector
supports a range of commands for managing log collection and application settings, offering flexibility for different environments.
These options configure how the logcollector
operates:
-
--console
or-c
: Runs thelogcollector
as a console application (default). Example:logcollector --console
-
--install
or-i
: Installs thelogcollector
as a system service (Windows only). Example:logcollector --install
-
--load=<path>
or-l
: Initializes thelogcollector
using the specified configuration file. Example:logcollector --load=/path/to/config.file
-
--service
or-s
: Runs thelogcollector
as an OS-managed service. Example:logcollector --service
-
--uninstall
or-u
: Uninstalls thelogcollector
service (Windows only). Example:logcollector --uninstall
When running as a console application, the following commands are available to manage logging and connected clients:
-
--save
or-a
: Save logs to a file. -
--unsave
or-b
: Stop saving logs to a file. -
--query
or-e
: Query the list of logging scopes. Example:--query *
-
--config
or-f
: Save the current configuration, including logging scopes, to a file. -
--help
or-h
: Display the help message. -
--instances
or-n
: Display the list of connected instances. -
--scope
or-o
: Update log scope priorities. Example:--scope *::areg_base_NESocket=NOTSET
-
--pause
or-p
: Pause logging connections. -
--quit
or-q
: Stop thelogcollector
and exit. -
--restart
or-r
: Restart logging connections. -
--silent
or-t
: Stop displaying data rates (only if build with enabled extended features). -
--verbose
or-v
: Display data rates (only if build with enabled extended features).