Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default log target to STDERR #74

Merged
merged 4 commits into from
Dec 13, 2023
Merged

Conversation

density215
Copy link
Member

@density215 density215 commented Dec 13, 2023

Starting Rotonda with a configuration file that contains (some specific) errors and no logging configuration, will exit with only issuing one empty line in the CLI, even if -vvvv was issued on many systems (including mine). This depends on the standard logging facility of the system.

Setting the default log_target to STDERR instead of the system default makes sure it will always output something on the terminal if no configuration for logging was somehow passed in (or accepted by rotonda). If, on the other hand, users purposefully add log targets that don't do anything, then they are of course on their own.

Since packages for most Linux distros use systemd, and are started with an explicit log facility, I think this is the correct way to do things.

to reproduce:

rotonda -vvvv -c rotonda.example.conf

with rotonda.example.conf:

# Rotonda Example configuration file.

roto_scripts_path = "etc/examples/filters/"

http_listen = ["127.0.0.1:8080"]

[units.bgp-in]
type = "bgp-tcp-in"
listen = "0.0.0.0:11179"
my_asn = 64512
my_bgp_id = [0, 0, 0, 0]
filter_name = "my-bagger-filter"

[targets.null]
type = "null-out"
sources = ["bgp-tcp-in"]

Where "my-bagger-filter" does not exist.

@partim
Copy link
Member

partim commented Dec 13, 2023

The issue is that the code in Config::finalise calls switch_logging(true), thus the logger assumes we are going into daemon mode and actives syslog as the default. If you just change that to false, all should work out as expected.

@density215 density215 merged commit 16cbb2b into main Dec 13, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants