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

Add syslog_formatter #3154

Closed
wants to merge 1 commit into from
Closed

Conversation

sivachandran
Copy link

The formatter enables remote(udp/tcp) syslog sink

Example:

    // run "nc -klu 514" to receive the syslog message
    spdlog::sinks::udp_sink_config udp_sink_config("127.0.0.1", 514);
    auto udp_logger = spdlog::udp_logger_mt("udp_logger", udp_sink_config);
    spdlog::syslog_formatter syslog_formatter(spdlog::facility::user, "localhost", "example");
    udp_logger->set_formatter(syslog_formatter.clone());
    udp_logger->info("this message will be logged in local syslog receiver");

@sivachandran sivachandran marked this pull request as draft August 15, 2024 05:10
@sivachandran sivachandran marked this pull request as ready for review August 15, 2024 05:20
The formatter enables remote(udp/tcp) syslog sink
@gabime
Copy link
Owner

gabime commented Aug 30, 2024

Thanks. Since this formatter’s sole purpose is for remote syslog, i suggest having a “remote_syslog” sink instead which would use udp/tcp sink under the hood with the right formatting. This also would make usage much easier without having to use a custom formatter.
Also note that some of the ci tests fail.
I will close this for now (PR with a new sink is welcome).

@gabime gabime closed this Aug 30, 2024
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