NetBurner Syslog Demo
Overview
This application demonstrates how to use the NetBurner Syslog utility to send logging information to a destination host computer via UDP on port 514. The demo sends a simple counting variable that increments every second to show elapsed time.
Features
- Network stack initialization with DHCP support
- Built-in web server on port 80
- Syslog messaging via UDP
- Support for both broadcast and targeted syslog transmission
- Real-time counting demonstration
How It Works
The application initializes the NetBurner network stack, waits for DHCP configuration to complete, and then begins sending syslog messages every second. Each message contains an incrementing counter showing elapsed seconds since startup.
Syslog Modes
The application supports two syslog transmission modes:
- Broadcast Mode: When
SysLogAddress
is not set, syslog data is sent as UDP broadcast to 255.255.255.255:514
- Targeted Mode: When
SysLogAddress
is configured, syslog data is sent to the specified IP address on port 514
Setup Instructions
Prerequisites
- NetBurner device with network connectivity
- Properly configured IP address and subnet mask
- NetBurner "UDP Terminal Tool" application (for receiving syslog messages)
Configuration Steps
- Verify Network Connection
- Ensure your NetBurner device has proper network communication
- Verify the device has obtained an IP address and subnet mask
- Configure Target Address (Optional)
- In
main.cpp
, locate the line: SysLogAddress =AsciiToIp("10.1.1.193");
- Replace "10.1.1.193" with your computer's IP address
- Comment out this line to use broadcast mode instead
- Setup Syslog Receiver
- Run the NetBurner "UDP Terminal Tool" application
- Set the local listening port to 514 (default syslog port)
- Deploy Application
- Download and run the application on your NetBurner device
Code Structure
Main Components
- Network Initialization: Sets up network stack and waits for DHCP completion
- System Diagnostics: Enables diagnostic features (should be removed for production)
- Web Server: Starts HTTP server on default port 80
- Syslog Loop: Continuously sends elapsed time messages every second
Key Functions
Expected Output
Once running, the application will:
- Display startup messages on the console
- Show IP address information
- Indicate whether syslog is running in broadcast or targeted mode
- Begin sending messages like: "Seconds elapsed: 0", "Seconds elapsed: 1", etc.
Network Requirements
- Protocol: UDP
- Port: 514 (standard syslog port)
- Default Target: 255.255.255.255 (broadcast) or configured IP address
Production Considerations
- Remove
EnableSystemDiagnostics()
call for production deployments
- Consider implementing proper error handling for network failures
- Adjust timing intervals based on logging requirements
- Implement log rotation or filtering for long-running applications
Troubleshooting
- No syslog messages received: Verify firewall settings and UDP port 514 access
- DHCP issues: Check network configuration and DHCP server availability
- Wrong target address: Verify the configured IP address in
SysLogAddress
- Network connectivity: Ensure proper physical network connection and IP configuration