This guide explains how to use Lusan as a live log viewer for Areg-based applications. Live log viewing enables developers to observe, filter, and analyze logs from distributed systems in real time while applications are running.
Lusan is designed for development, debugging, system integration, performance analysis, and runtime diagnostics of complex multi-process and multi-threaded systems.
- Overview
- Why Use Live Log Viewing
- Prerequisites
- Step-by-Step Guide to Live Log Viewing
- Troubleshooting Live Logging
- Performance Considerations
- Summary
The Areg SDK provides a built-in logging infrastructure optimized for distributed, multi-process, and multi-threaded architectures. Logs generated by multiple applications can be collected centrally and visualized in real time.
Lusan acts as a centralized live log viewer that aggregates logs from multiple threads, processes, and devices into a single, unified interface. This provides immediate visibility into system behavior and significantly reduces the time required to debug complex interactions.
- Interactive development and debugging
- Real-time performance monitoring
- Cross-service and cross-process interaction tracing
- Runtime troubleshooting without restarting applications
Areg-based Applications
Generate structured runtime logs with configurable scopes and priorities.
Log Collector (logcollector)
Aggregates logs from all applications at runtime, acting as a central collection point.
Lusan
Connects to logcollector and visualizes logs live with filtering, searching, and analysis capabilities.
Note
Lusan does not generate logs itself, but creates logging file. It connects to the Areg logging infrastructure, saves logs to the database and provides visualization, filtering, analysis, and runtime control.
Live log viewing with Lusan enables:
- Immediate Visibility: Real-time insight into distributed system behavior
- Centralized Aggregation: Logs from multiple applications and machines in one view
- Event Correlation: Trace interactions across processes and threads
- Runtime Debugging: Diagnose issues without application restarts
- Dynamic Control: Adjust logging scopes and priorities on-the-fly
These capabilities make Lusan especially valuable for diagnosing timing issues, race conditions, and cross-component interactions in distributed systems.
Before starting live log monitoring, ensure the following components are available and correctly configured.
| Component | Description |
|---|---|
| Lusan | Built from areg-sdk-tools repository |
| logcollector | Built from Areg SDK, serves as log aggregation service |
| Areg Applications | Applications with logging enabled |
| Configuration Files | areg.init for applications/logcollector, lusan.init for Lusan |
Both areg.init (for applications and logcollector) and lusan.init (for Lusan) must define the same log service endpoint:
logger::*::service = logcollector # Log collector process name
logger::*::connect = tcpip # Communication protocol
logger::*::enable::tcpip = true # Enable TCP/IP
logger::*::address::tcpip = 127.0.0.1 # IP address (default: localhost)
logger::*::port::tcpip = 8282 # Port number (default: 8282)
Important
All applications and Lusan must use the same configuration to communicate with logcollector.
Example Configuration:
- For local development:
logger::*::address::tcpip = 127.0.0.1 - For distributed systems:
logger::*::address::tcpip = 192.168.1.100(logcollector host IP)
Run logcollector as a console application or system service on a reachable machine.
Prerequisites:
areg.initfile is accessible tologcollector- TCP/IP address and port are correctly configured
- Network allows connections on the configured port
logcollector acts as the central aggregation point for all runtime logs.
./build/bin/logcollectorConsole mode is recommended for development and debugging as it provides immediate feedback.
Linux (systemd):
sudo systemctl enable logcollector.service
sudo systemctl start logcollector.serviceWindows:
.\logcollector.exe --install
net start logcollectorTip
For detailed information about running logcollector as a service, see Areg SDK Log Collector Service.
- ✅ Confirm successful startup in console or service logs
- ✅ Verify service listens on configured port (default: 8282)
- ✅ Ensure
areg.initfile is accessible
Testing Port Availability:
# Linux/macOS
netstat -an | grep 8282
# Windows
netstat -an | findstr 8282Port Already in Use
- Change the port in
areg.init:logger::*::port::tcpip = 8283 - Kill conflicting process or use a different port
Permission Denied
- Run with appropriate privileges (sudo on Linux, Administrator on Windows)
- Check firewall rules allow the port
Configuration Not Found
- Ensure
./config/areg.initexists or specify path with environment variable - Verify file permissions allow reading
Launch Lusan and establish a connection to the running logcollector service.
-
Start Lusan Application
cd build/bin ./lusan -
Initiate Live Logging:
- Method 1: Menu → File → New Live Logs
- Method 2: Click New Live Logs toolbar button
- Method 3: Navigation pane → Live Logs tab → Connect to Log Collector
-
Automatic Connection:
- Lusan reads settings from
./config/lusan.init - Connects to configured
logcollectoraddress and port - Begins recording logs in real-time mode
- Lusan reads settings from
-
Verify Connection Status:
- Check for message:
Log observer connected to Log Collector service. - Connection indicator shows green status
- Check for message:
Lusan automatically saves logs in two formats:
SQLite Database (.sqlog)
- Primary storage format
- Optimized for Lusan's offline log viewer
- Supports advanced filtering and queries
- Recommended for long-term storage and analysis
Plain Text (.log)
- Human-readable format
- Can be opened with any text editor
- Useful for quick inspection and sharing
- Compatible with standard log analysis tools
Tip
Use SQLite database format (.sqlog) as primary storage for comprehensive offline analysis with Lusan's offline log viewer.
With logcollector running and Lusan connected, start your Areg-based applications.
Note
Applications may be started before Lusan connects. Logs will be captured once Lusan establishes connection to logcollector.
Required Configuration:
areg.initfile is present and accessible- Logging is enabled:
log::*::enable = true - Remote logging is enabled:
log::*::enable::remote = true - Log service configuration matches
logcollectorsettings
Example Application Configuration:
log::*::enable = true
log::*::enable::remote = true
log::*::remote::service = logger
log::*::scope::* = DEBUG | SCOPE
Lusan can monitor logs from:
- Multiple Applications: On the same machine
- Distributed Processes: On different machines across the network
- Multiple Threads: Within each process
- Service Providers and Consumers: All components in a distributed system
Applications automatically connect to logcollector at startup:
- Application reads
areg.initconfiguration - Establishes connection to configured log collector
- Begins sending log messages based on scope priorities
- Messages appear in Lusan's log viewer in real time
Once connected, logs from all applications appear in the Lusan log viewer in real time.
Real-Time Display
- Logs appear with minimal latency (typically < 100ms)
- Automatic scrolling to newest entries
- Color-coded priority levels for visual distinction
Log Entry Information
Each log entry displays:
- Timestamp: Date and time of log generation
- Priority: DEBUG, INFO, WARN, ERROR, FATAL, or SCOPE
- Source: Application (process) name and ID
- Thread: Thread name and ID
- Scope: Logging scope (function/component identifier)
- Message: Log message text
Interactive Controls
- Pause/Resume: Freeze log stream for detailed inspection
- Clear: Clear current log buffer
- Auto-Scroll: Toggle automatic scrolling to newest entries
- Export: Save filtered logs to file
| Priority | Color | Description |
|---|---|---|
| DEBUG | Gray | Detailed diagnostic information |
| INFO | Blue | General informational messages |
| WARN | Yellow | Warning messages (potential issues) |
| ERROR | Orange | Error messages (failures occurred) |
| FATAL | Red | Fatal errors (critical failures) |
| SCOPE | Green | Function entry/exit boundaries |
Lusan provides multiple filtering mechanisms to isolate relevant log entries.
Change logging priorities at the source application level, affecting which logs are generated and sent to logcollector.
How to Use:
- Open Live Logs navigation pane
- Expand application node to view scopes
- Right-click scope → Change Priority
- Select new priority level or disable scope
- Changes take effect immediately
Benefits:
- Reduces network traffic by filtering at source
- Decreases
logcollectorload - Improves application performance by skipping log generation
Filter already received logs in the log viewer. This filtering is performed on the Lusan side—logs of unselected priorities are hidden from view but remain in the buffer.
Supported Filtering Criteria:
| Filter Type | Description |
|---|---|
| Priority Level | Show only messages of selected priority levels (DEBUG, INFO, WARN, ERROR, FATAL, SCOPE) |
| Duration | Show only messages with duration ≥ specified value (for scope entry/exit timing) |
| Source | Show only messages from specified application name |
| Source ID | Show only messages from specified process ID |
| Thread | Show only messages from specified thread name |
| Thread ID | Show only messages from specified thread ID |
| Text Phrase | Show only messages containing specified text (supports wildcards: *, ?) |
Applying Filters:
- Click arrow on column header
- Select filter criteria
- Multiple filters can be applied simultaneously
- Clear filters to show all messages
Advanced filtering by selecting and analyzing specific scope sessions.
How to Use:
- Double-click a log message in the main viewer
- Log Analyzer Window opens at the bottom (tab: Scope Analyzes)
- Select filtering mode using radio buttons
Filtering Modes:
- Session Logs: Show only messages from the selected scope session
- Session Sublogs: Show messages from selected session and all child scopes
- Scope Logs: Show all messages from the scope, regardless of session
- Thread Logs: Show all messages from the thread, regardless of scope
- Process Logs: Show all messages from the process, regardless of thread or scope
Use Cases:
- Trace execution flow through a single function call
- Analyze nested scope hierarchies
- Investigate thread-specific behavior
- Debug process-wide interactions
Progressive Narrowing:
- Start with broad filters (e.g., filter by process)
- Narrow down by thread
- Further narrow by scope or text phrase
- Use scope analyzer for detailed investigation
Performance Optimization:
- Use source-side filtering for high-volume logs
- Combine multiple filters for precise investigation
- Clear filters periodically to avoid missing related events
Lusan enables dynamic control of logging behavior without restarting applications.
Enable/Disable Log Scopes
- Turn specific component logging on or off
- Change logging priority levels in real time
- Reduce noise from verbose components
- Enable detailed logging for components under investigation
Adjust Priority Levels
- Increase verbosity:
INFO→DEBUG→ addSCOPE - Reduce verbosity to minimize overhead
- Per-scope priority control
- Independent control for each application
Application-Wide Settings
- Enable/disable all logging for an application
- Bulk scope management
- Quick toggles for emergency situations
Save Configuration
- Save current
logcollectorconnection settings (IP address and port) - Save logging scope priorities for all applications
- Persisted configuration used on next application start
Steps:
- Configure desired scope priorities in the Live Logs navigation pane
- Click Save log settings toolbar button
- Lusan collects scope priority information from each application
- Sends configuration change request to applications
- Applications save configuration to
areg.init - On next start, applications use saved priorities
Configuration Persistence:
- Scope priorities saved in
areg.initfile - Settings persist across application restarts
- Can be version-controlled with project configuration
Note
Logs are generated if lower-level logging is enabled. For example:
- Scope with
INFOlevel generates: INFO, WARN, ERROR, FATAL SCOPEpriority is independent and must be enabled explicitly- Users can disable log priorities while keeping
SCOPEenabled - If
SCOPEis not enabled, no entry/exit messages are generated
Priority Levels (Ascending Order):
- DEBUG (lowest) - Generates: DEBUG, INFO, WARN, ERROR, FATAL
- INFO - Generates: INFO, WARN, ERROR, FATAL
- WARN - Generates: WARN, ERROR, FATAL
- ERROR - Generates: ERROR, FATAL
- FATAL (highest) - Generates: FATAL only
- SCOPE (independent) - Generates: Enter/Exit scope messages
- NOTSET - Disables logging for the scope
- No Downtime: Adjust logging without service interruption
- Performance Optimization: Disable verbose logging in production
- Targeted Debugging: Enable detailed logs only where needed
- Production Diagnostics: Safely investigate issues in live systems
Production Environments:
- Keep default logging at
INFOorWARNlevel - Disable
SCOPElogging by default (reduces overhead) - Enable
DEBUGandSCOPEonly when actively investigating - Disable verbose logging after capturing necessary information
Development Environments:
- Use
DEBUG | SCOPEfor active development - Reduce verbosity in stable components
- Document scope purposes for effective filtering
Performance-Critical Systems:
- Minimize logging in hot paths
- Use fire-and-forget logging patterns
- Monitor
logcollectorresource usage
Verify logcollector is running.
Linux:
ps aux | grep logcollectorWindows:
tasklist | findstr logcollectorIf not running, start logcollector as described in Step 1.
Test connection to logcollector service port:
# Using telnet
telnet 127.0.0.1 8282
# Using netcat
nc -zv 127.0.0.1 8282
# Using curl (if HTTP endpoint available)
curl http://127.0.0.1:8282Expected Result: Connection successful or port responding.
Check areg.init for applications and logcollector:
- File exists and is readable:
./config/areg.init - Logging is enabled:
log::*::enable = true - Remote logging is enabled:
log::*::enable::remote = true - Service address matches
logcollectorhost - Port number matches
logcollectorconfiguration
Check lusan.init for Lusan:
- File exists and is readable:
./config/lusan.init - Logger service configuration matches
logcollector
Check that application scopes have logging enabled:
log::*::scope::* = DEBUG | SCOPE # Enable all scopes
If scopes are set to NOTSET, no logs will be generated.
Symptoms: Lusan lag, high CPU usage, memory consumption
Solutions:
- Increase filter specificity to reduce displayed logs
- Disable unnecessary scopes at source
- Reduce priority verbosity (INFO instead of DEBUG)
- Use offline analysis for intensive logging scenarios
- Clear log buffer periodically
Symptoms: Delayed log appearance, connection timeouts
Solutions:
- Ensure
logcollectorruns on the same network segment - Check for network congestion or bandwidth issues
- Consider local
logcollectorinstances for remote sites - Use wired connections instead of wireless for critical systems
Symptoms: Lusan or logcollector consuming excessive memory
Solutions:
- Enable log rotation in
logcollector - Clear old logs from Lusan buffer
- Reduce log retention time
- Increase system RAM if log volume is legitimately high
Symptoms: Intermittent log gaps, disconnection messages, connection lost errors
- Verify network connection between Lusan and
logcollectoris stable - Check for intermittent network issues
- Review router/switch logs for errors
- Check
logcollectorCPU usage (should be < 50%) - Check
logcollectormemory usage - Review
logcollectorlogs for errors or warnings - Ensure
logcollectorservice has not crashed
- Verify firewall allows TCP port 8282 (or configured port)
- Check network policies don't block connections
- Temporarily disable firewall to test (development only)
If logcollector has crashed:
- Review crash logs or core dumps
- Check system resource limits (ulimit on Linux)
- Verify sufficient disk space for log files
- Restart
logcollectorservice
Resource Usage:
- CPU: Minimal during normal operation (< 5%)
- Memory: Scales with log volume and buffer size (typically 100-500 MB)
- Network: Depends on log volume (typical: 1-10 Mbps)
Best Practices:
- Use filtering to reduce processed log volume
- Clear old logs periodically during long sessions
- Close unused live log connections
- Monitor Lusan resource usage on constrained systems
Resource Usage:
- CPU: Scales with number of connected applications and log volume
- Memory: Buffering and log storage (typical: 200 MB - 2 GB)
- Network: Aggregate of all application log streams
- Disk I/O: If saving logs to disk
Optimization:
- Run
logcollectoron dedicated hardware for large deployments - Use SSD storage for log files
- Configure log rotation to manage disk space
- Monitor resource usage with system tools
Default Logging Levels:
- Production:
log::*::scope::* = INFO(without SCOPE) - Staging:
log::*::scope::* = INFO | SCOPE - Development:
log::*::scope::* = DEBUG | SCOPE
Scope Enablement:
- Enable
DEBUGandSCOPEselectively and temporarily - Monitor impact on application performance
- Disable verbose logging after investigation
Infrastructure:
- Dedicated logging infrastructure for high-volume systems
- Monitor
logcollectorresource usage continuously - Set up alerts for connection issues or resource exhaustion
- Plan for log storage capacity (estimate 10-100 MB/hour per application)
Key Metrics:
- Log message rate (messages/second)
- Network bandwidth usage
logcollectorCPU and memory usage- Application performance impact (compare with logging disabled)
Alerting:
- Set alerts for high message rates
- Monitor connection drops
- Alert on
logcollectorresource exhaustion
Lusan's live log viewer transforms distributed logging from a challenge into a powerful development and debugging tool. By centralizing logs, providing real-time visibility, and enabling dynamic control, Lusan significantly reduces the time required to understand and diagnose issues in complex Areg-based systems.
- ✅ Centralized View: All distributed logs in a single interface
- ✅ Real-Time Monitoring: Minimal latency (< 100ms typical)
- ✅ Powerful Filtering: Multiple criteria, scope analysis, text search
- ✅ Runtime Control: Adjust logging without application restarts
- ✅ Dual Format Logging: SQLite database and plain text
- Distributed system development and debugging
- Multi-threaded application analysis
- Production troubleshooting and diagnostics
- System integration testing
- Performance optimization
- Explore Offline Analysis: Lusan Offline Log Analysis for post-mortem debugging
- Configure Log Collector: Log Collector Service Setup for production deployment
- Optimize Configuration: Key-Value Data Persistence for advanced settings
Copyright © 2026, Aregtech, www.areg.tech, email: info[at]areg.tech





