How to Enable Debug Logs Without Degrading Performance in InternetIncome
Set ENABLE_LOGS=true in properties.conf only during active debugging sessions, or use per-container environment overrides to capture targeted diagnostics without incurring the global I/O penalty.
InternetIncome is an open-source Docker orchestration framework for passive income generation that tightly couples logging behavior with system performance. The repository uses a centralized boolean flag to determine whether containers run with full JSON logging or zero-overhead null drivers, making it critical to understand the trade-offs before enabling debug output in production environments.
Understanding the ENABLE_LOGS Architecture
The logging strategy in InternetIncome hinges on a single configuration value defined in the properties file and consumed by the main shell orchestrator.
Configuration File Location
The user-facing toggle resides in properties.conf at lines 23–24:
# Enable logs (true/false)
ENABLE_LOGS=false
Changing this value to true signals the orchestration script to append logging drivers to every docker run command issued during the session.
Script-Level Implementation
In internetIncome.sh (lines 157–163), the script evaluates ENABLE_LOGS to construct the LOGS_PARAM and TUN_LOG_PARAM variables:
if [ "${ENABLE_LOGS}" = "true" ]; then
LOGS_PARAM="--log-driver=json-file --log-opt max-size=100k"
TUN_LOG_PARAM="-e LOG_LEVEL=debug"
else
LOGS_PARAM="--log-driver none"
TUN_LOG_PARAM="-e LOG_LEVEL=silent"
fi
These parameters are injected into container instantiation commands at lines 244, 257, and 265, ensuring consistent logging behavior across the entire fleet.
Performance Impact of Debug Logging
Enabling logs introduces measurable overhead because Docker’s json-file driver writes every stdout and stderr stream to disk with rotation policies.
When ENABLE_LOGS=false:
- The
--log-driver nonedirective discards all container output immediately. - The tunnel container runs with
LOG_LEVEL=silent, suppressing internal verbosity. - CPU cycles and disk I/O are minimized, which is essential for ARM devices like Raspberry Pi running dozens of proxy containers.
When ENABLE_LOGS=true:
- Docker writes JSON logs to
/var/lib/docker/containers/<id>/<id>-json.logwith a 100 KB rotation limit. - The tunnel container emits debug-level diagnostics, increasing memory pressure.
- Concurrent logging from hundreds of income-generating containers can saturate disk throughput on low-spec hosts.
Methods to Enable Debug Logs Without Performance Degradation
You can capture diagnostic data while maintaining system throughput by using temporary global toggles or targeted per-container overrides.
Temporary Global Enable (Recommended for Short Sessions)
Because properties.conf is a plain-text file, you can script the toggle to enable logs only during active debugging:
# Enable debug logs for this session only
sed -i 's/^ENABLE_LOGS=.*$/ENABLE_LOGS=true/' properties.conf
# Restart the orchestrator to apply the new configuration
sudo bash internetIncome.sh --restart
All containers will now emit JSON logs viewable via docker logs. When diagnostics are complete, revert the change to restore peak performance:
# Disable logs to eliminate I/O overhead
sed -i 's/^ENABLE_LOGS=.*$/ENABLE_LOGS=false/' properties.conf
sudo bash internetIncome.sh --restart
Per-Container Debug Overrides (Targeted Debugging)
If you need visibility into a specific component—such as the HEV-Socks5-Tunnel—without enabling global logging, manually launch that container with debug parameters while keeping ENABLE_LOGS=false in the main configuration:
# Run a single tunnel container with debug logging enabled
sudo docker run -d \
--name tun_debug \
--log-driver=json-file --log-opt max-size=100k \
-e LOG_LEVEL=debug \
-e SOCKS5_ADDR="127.0.0.1" \
-e SOCKS5_PORT="1080" \
ghcr.io/heiher/hev-socks5-tunnel:latest
This approach isolates the performance penalty to a single container, leaving the remaining fleet running with --log-driver none for maximum efficiency.
Accessing and Managing Logs
Once logging is enabled, retrieve diagnostic data using standard Docker CLI commands:
View logs for a specific container:
docker logs --tail 50 -f tun${UNIQUE_ID}1
Verify the active log driver for a running container:
docker inspect --format '{{ .HostConfig.LogConfig.Type }}' tun${UNIQUE_ID}1
# Returns "json-file" when enabled, "none" when disabled
Clean up after debugging:
# Remove the temporary debug container
docker rm -f tun_debug
# Reset global configuration
awk '/^ENABLE_LOGS/{$0="ENABLE_LOGS=false"}1' properties.conf > tmp && mv tmp properties.conf
Summary
- InternetIncome uses the
ENABLE_LOGSflag inproperties.confto toggle between zero-overhead (--log-driver none) and diagnostic (--log-driver json-file) modes. - Enabling logs globally writes JSON files with 100 KB rotation, which degrades performance on resource-constrained devices due to disk I/O.
- Best practice: Keep
ENABLE_LOGS=falsefor production workloads; temporarily switch totrueonly during active debugging sessions usingsedorawkto modifyproperties.conf. - For surgical diagnostics, manually launch individual containers with
--log-driver=json-fileandLOG_LEVEL=debugwhile keeping the global flag disabled, isolating the performance impact to a single service.
Frequently Asked Questions
What is the default value of ENABLE_LOGS in InternetIncome?
By default, ENABLE_LOGS is set to false in properties.conf (lines 23–24). This default ensures that new deployments operate at maximum performance by using the --log-driver none Docker option, which discards all container output without writing to disk.
Does enabling debug logs affect all containers or only specific ones?
When ENABLE_LOGS=true is set in properties.conf, the internetIncome.sh script applies the --log-driver=json-file parameter to every container it launches, including income apps and tunnel proxies. This global behavior ensures consistent logging across the fleet but also means the performance penalty applies system-wide, which is why temporary or per-container overrides are recommended for targeted debugging.
How can I check if a container is running with debug logging enabled?
You can verify the active log driver by inspecting the container’s host configuration. Run docker inspect --format '{{ .HostConfig.LogConfig.Type }}' <container_name>. If the output is json-file, the container is writing debug logs to disk; if it returns none, logging is disabled and the container is running in performance-optimized mode.
Is there a way to enable logs for just one application without changing properties.conf?
Yes, you can bypass the global flag by manually starting the specific container with the --log-driver=json-file option and the appropriate LOG_LEVEL environment variable. For example, launch the HEV-Socks5-Tunnel directly with docker run while keeping ENABLE_LOGS=false in the configuration file. This isolates the logging overhead to that single container, preserving performance for the rest of the deployment.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →