Areg SDK Log Observer Application
April 4, 2026 · View on GitHub
The Areg SDK Log Observer is a console application for real-time log monitoring, management, and dynamic scope control of logs received from distributed applications.
Tip
Log Observer connects to Log Collector to receive, store, and control logs from multiple applications across your network.
Table of Contents
- Quick Start
- Overview
- Installation
- Running Log Observer
- Interactive Commands
- Configuration
- Common Scenarios
- Troubleshooting
Quick Start
Start Receiving Logs in 1 Minute
Step 1: Start Log Collector
# Terminal 1 - Start log collector service
./product/build/gnu-g++/linux-64-x86_64-release-shared/bin/logcollector --console
Step 2: Start Log Observer
# Terminal 2 - Start log observer
./product/build/gnu-g++/linux-64-x86_64-release-shared/bin/logobserver
Expected output:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
The log observer is initialized, type '-r' to connect.
Type '-q' or '--quit' to quit the application ...:
Step 3: Start receiving logs
Type -r or --restart in Log Observer console:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
Log observer triggered connection.
Type '-q' or '--quit' to quit the application ...:
Step 4: Run your application with remote logging
# Terminal 3 - Run your application
./myapp
Logs saved to:
- Text file:
./logs/myapp_2026_01_25_23_39_41_801.log.log - Database:
./logs/log_2026_01_26_17_58_32_215.sqlog
Setup time: ~1 minute
Overview
What is Log Observer?
The Log Observer is a console application that acts as a client to Log Collector, providing:
Data Management:
- ✅ Receive logs from multiple distributed applications
- ✅ Save logs to text files
- ✅ Store logs in SQLite database for analysis
- ✅ Real-time log controlling in console
Dynamic Control:
- ✅ Adjust scope activation at runtime
- ✅ Change log priorities without restarting applications
- ✅ Filter log messages dynamically
- ✅ Query connected application instances
Architecture
┌─────────────┐ ┌──────────────┐ ┌──────────────┐
│ Application │────────►│ Log │◄────────│ Log │
│ A │ │ Collector │ │ Observer │
└─────────────┘ │ (Server) │ │ (Client) │
│ │ │ │
┌─────────────┐ │ Port 8282 │ │ - Stores │
│ Application │────────►│ │ │ - Controls │
│ B │ │ │ │ - Queries │
└─────────────┘ └──────────────┘ └──────────────┘
Components:
- Applications - Send logs to Log Collector
- Log Collector - Central log aggregation service
- Log Observer - Receives, stores, and controls logs
Note
Multiple Log Observer instances can connect to the same Log Collector simultaneously. The Log Collector broadcasts all log messages to every connected observer, enabling each to independently store logs in files and databases. Log Observer uses SQLite3 as its database engine for structured log storage and analysis.
Key Features
| Feature | Description | Benefit |
|---|---|---|
| Real-time Monitoring | View logs as they arrive | Immediate feedback |
| Dual Storage | Text files + SQLite database | Flexible analysis |
| Dynamic Scope Control | Change scopes without restart | Optimize network traffic |
| Multi-application | Logs from all connected apps | Centralized monitoring |
| Query Scopes | List available scopes | Discover logging points |
| Save Configuration | Export current scope settings | Reproduce setups |
| Multi-Observer Support | Multiple observers can connect | Team collaboration |
When to Use Log Observer
Use Log Observer when:
- ✅ Monitoring distributed applications without
Lusanapplication - ✅ Need database storage for analysis
- ✅ Runtime scope control required
- ✅ Centralized log collection needed
Alternative tools:
- Lusan - GUI log viewer (Lusan Live Log Viewer)
- Text files - Direct file logging (Logging Configuration)
Installation
From Build Directory
After building Areg SDK, Log Observer is available in the build output directory.
Default build paths:
Linux:
./product/build/gnu-g++/linux-64-x86_64-release-shared/bin/logobserver
Windows:
.\product\build\msvc-v143\windows_nt-x64-release\bin\logobserver.exe
From Installed Location
If Areg SDK is installed via CMake:
# Install Areg SDK
sudo cmake --install ./build
# Log Observer location
/usr/local/tools/areg/logobserver # Linux
C:\Program Files\areg\tools\areg\logobserver.exe # Windows
Prerequisites
Required:
- Log Collector must be running
- Network connectivity to Log Collector
- Applications configured for remote logging
Optional:
- SQLite3 (bundled with Areg SDK)
- Write permissions for log directory
Running Log Observer
Start in Console Mode
Basic usage:
./logobserver
Expected output:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
The log observer is initialized, type '-r' to connect.
Type '-q' or '--quit' to quit the application ...:
Start with Custom Configuration
Specify configuration file:
./logobserver --load="./config/custom.init"
Connect and Start Receiving
Once started, activate log reception:
Type -r or --restart:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
Log observer triggered connection.
Type '-q' or '--quit' to quit the application ...:
Check connected applications:
Type -n or --instances:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
List of connected instances ...
Type '-q' or '--quit' to quit the application ...:
---------------------------------------------------------------------------------------------
Nr. | Inst. ID | Bits | Scopes | Name
---------------------------------------------------------------------------------------------
1. | 257 | x64 | 87 | 19_pubclient.exe
---------------------------------------------------------------------------------------------
Stop Receiving
Pause log reception:
Type -x or --stop:
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
Log observer stops, type '-r' to resume.
Type '-q' or '--quit' to quit the application ...:
Type -r again to resume.
Interactive Commands
Command Reference
Commands available while Log Observer is running:
| Command | Alias | Description | Example |
|---|---|---|---|
--help | -h | Display command list | -h |
--instances | -n | Show connected applications | -n |
--query | -e | Display application scopes | -e myapp |
--scope | -o | Set scope priority | -o myapp::scope_*=DEBUG |
--config | -f | Save current configuration | -f |
--restart | -r | Start/restart receiving logs | -r |
--stop | -x | Stop receiving logs | -x |
--pause | -p | Pause log observer | -p |
--quit | -q | Quit application | -q |
--load | -l | Load configuration file | -l=config.init |
Command Examples
1. Display help: type -h or `--help``
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
Type '-q' or '--quit' to quit the application ...:
Usage of Areg Log Observer console application :
---------------------------------------------------------------------------------------------
-e, --query : Query the list of logging scopes. Usage: --query *, '*' can be a cookie ID.
-f, --config : Save current configuration. Usage: --config
-h, --help : Display this message on console. Usage: --help
-l, --load : Command line option to configure. Usage: './logobserver --load=<path-to-init-file>'
-n, --instances : Display list of log instances. Usage: --instances
-o, --scope : Update log scope priorities. Usage: --scope *::areg_base_socket_defs=NOTSET, '*' can be a cookie.
-p, --pause : Pause the log observer. Usage: --pause
-q, --quit : Stop and quit the log observer. Usage: --quit
-r, --restart : Start / continue log observer. Usage: --restart
-x, --stop : Stop log observer. Usage: --stop
---------------------------------------------------------------------------------------------
2. Show connected applications: type -n or --instances
Areg Log Observer console application ...
---------------------------------------------------------------------------------------------
List of connected instances ...
Type '-q' or '--quit' to quit the application ...:
---------------------------------------------------------------------------------------------
Nr. | Inst. ID | Bits | Scopes | Name
---------------------------------------------------------------------------------------------
1. | 257 | x64 | 87 | 19_pubclient.exe
2. | 258 | x64 | 132 | 19_pubservice.exe
---------------------------------------------------------------------------------------------
3. Change scope priority: type -o provider::provider_Network_connect=DEBUG
Enable all scopes with wildcard: type -o myapp::*=DEBUG|SCOPE
4. Save current configuration: type -f
Generated config file:
ini log::provider::scope::provider_main.initialize = DEBUG | SCOPE log::provider::scope::provider_ServiceImpl.process_data = DEBUG | SCOPE log::provider::scope::provider_Network.connect = DEBUG
5. Pause and resume: type -p to pause, -r to resume`
6. Quit application: type -q or --quit
Configuration
Configuration File
Default: areg.init in Log Observer directory
Custom location:
logobserver --load="./config/custom.init"
Log Collector Connection
Configure connection to Log Collector:
# Log Collector connection settings
logger::*::service = logcollector # Service name
logger::*::connect = tcpip # Protocol
logger::*::enable::tcpip = true # Enable TCP/IP
logger::*::address::tcpip = 127.0.0.1 # Log Collector IP
logger::*::port::tcpip = 8282 # Log Collector port
Configuration breakdown:
| Property | Default | Description |
|---|---|---|
logger::*::service | logcollector | Log Collector process name |
logger::*::connect | tcpip | Communication protocol |
logger::*::enable::tcpip | true | Enable/disable TCP/IP |
logger::*::address::tcpip | 127.0.0.1 | Log Collector IP address |
logger::*::port::tcpip | 8282 | Log Collector port |
Log Storage Configuration
Configure where logs are saved:
# Enable file and database logging
log::logobserver::enable::file = true
log::logobserver::enable::db = true
# Database settings
log::logobserver::db::name = sqlite3
log::logobserver::db::location = ./logs/log_%time%.sqlite3
# File location (default)
log::logobserver::file::location = ./logs/logobserver.log
Message Layout
Customize log message format:
# Scope entry layout
log::logobserver::layout::enter = %d: [ %a.%x.%t.%z: Enter -->]%n
# Log message layout
log::logobserver::layout::message = %d: [ %a.%x.%t.%p >>> ] %m%n
# Scope exit layout
log::logobserver::layout::exit = %d: [ %a.%x.%t.%z: Exit <-- ]%n
Format specifiers:
%d- Date and time%a- Application instance ID%x- Application name%t- Thread ID%p- Priority level%m- Message text%z- Scope name%n- Newline
See: Logging Configuration Guide for complete format reference
Disable Log Observer's Own Logging
Prevent Log Observer from logging about itself:
# Disable Log Observer self-logging
log::logobserver::scope::* = NOTSET
log::logcollector::scope::* = NOTSET
Network Deployment
Scenario: Log Observer on different machine from Log Collector
Machine 1 (192.168.1.100) - Log Collector:
./logcollector --console
Machine 2 (192.168.1.101) - Log Observer:
# logobserver config
logger::*::address::tcpip = 192.168.1.100
logger::*::port::tcpip = 8282
./logobserver --console --load="./config/remote.init"
Common Scenarios
Scenario 1: Monitor All Applications
Goal: Receive logs from all connected applications.
Steps:
- Start Log Collector:
./logcollector --console - Start Log Observer:
./logobserver - Start receiving: type
-r - Check connected apps:
-n
Scenario 2: Debug Specific Module
Goal: Enable detailed logging for specific module at runtime. Steps: Set log priority for network module to DEBUG
-o myapp::myapp_network_*=DEBUG|SCOPE
Scenario 3: Reduce Network Traffic
Goal: Decrease network traffic by filtering low-priority logs.
Steps: Set all scopes to WARN
-o myapp::*=WARN
Result: Only warnings and errors transmitted.
Scenario 4: Save Configuration for Later
Goal: Save current scope settings to reproduce later.
Steps:
- Configure scopes as needed:
-o app1::module_*=DEBUG -o app2::network_*=INFO -o app2::database_*=ERROR - Save configuration: type
-f - Later, load saved configuration:
./logobserver --load="./config/logobserver_config.init"
Result: Same scope settings restored.
Scenario 5: Database Analysis
Goal: Analyze logs using SQL queries. Steps:
- Ensure database logging enabled:
log::logobserver::enable::db = true log::logobserver::db::location = ./logs/log_%time%.sqlite3 - Collect logs: type
-r - Open database with SQLite:
sqlite3 ./logs/log_20260127_103045.sqlite3 - Query logs:
-- Count errors per application SELECT app_name, COUNT(*) FROM logs WHERE priority = 'ERROR' GROUP BY app_name;
Result: Powerful SQL-based log analysis.
Troubleshooting
Cannot Connect to Log Collector
Problem: Log Observer cannot connect to Log Collector.
Solution:
- Verify Log Collector is running:
# Check process ps aux | grep logcollector # Linux tasklist | findstr logcollector # Windows - Check network connectivity:
telnet 127.0.0.1 8282 # or nc -zv 127.0.0.1 8282 - Verify configuration:
logger::*::address::tcpip = 127.0.0.1 # Correct address? logger::*::port::tcpip = 8282 # Correct port? - Check firewall:
# Linux sudo ufw allow 8282/tcp # Windows New-NetFirewallRule -DisplayName "Log Collector" -Direction Inbound -Protocol TCP -LocalPort 8282 -Action Allow
No Logs Received
Problem: Log Observer connected but no logs appear.
Solution:
- Start receiving: type
-r - Check connected applications: type
-n - Verify applications are configured for remote logging:
# In application's areg.init log::*::target = remote logger::*::address::tcpip = 127.0.0.1 logger::*::port::tcpip = 8282 - Check application scopes are enabled:
> -e myapp Check if scopes are not set to NOTSET
Database File Not Created
Problem: SQLite database file doesn't exist.
Solution:
- Check database logging is enabled:
log::logobserver::enable::db = true - Check directory exists:
mkdir -p ./logs - Check write permissions:
chmod 755 ./logs - Verify database location:
log::logobserver::db::location = ./logs/log_%time%.sqlite3 - Restart Log Observer:
Scope Changes Not Working
Problem: Changed scope priority but no effect.
Solution:
- Verify correct application name: type
-n - Use correct syntax:
# Correct > -o myapp::module_network=DEBUG > -o myapp::module_*=DEBUG|SCOPE # Wrong > -o myapp module_network DEBUG - Verify application supports dynamic scope changes:
Applications must be connected to Log Collector to receive scope updates.
Log File Too Large
Problem: Log files growing too large. Solution:
- Reduce log level:
> -o *::*=WARN All applications set to WARN - Disable file logging:
log::logobserver::enable::file = false # Keep only database log::logobserver::enable::db = true - Use separate files per run:
log::logobserver::file::location = ./logs/log_%time%.log
Additional Resources
Related Guides:
- Log Collector Guide - Central log collection service
- Logging Configuration Guide - Configure application logging
- Logging Development Guide - Add logging to code
- Lusan Live Log Viewer - GUI log viewer alternative
Configuration Files:
- areg.init - Default configuration
Source Code:
- logobserver Module - Implementation
- areglogger Library - Log observer API
Help: For questions, open a discussion or issue on GitHub.
Copyright © 2026, Aregtech, www.areg.tech, email: info[at]areg.tech