Skip to content

Using syslog facility to log to custom file #2123

Answered by tt4g
ozcanay asked this question in Q&A
Discussion options

You must be logged in to vote

First of all, I don't usually use syslog, so I may be guiding you wrongly.

Looking at the function declaration, it is the fourth argument of spdlog::syslog_logger_mt() that corresponds to the third argument facility of openlog().

// Create and register a syslog logger
template<typename Factory = spdlog::synchronous_factory>
inline std::shared_ptr<logger> syslog_logger_mt(const std::string &logger_name, const std::string &syslog_ident = "", int syslog_option = 0,
int syslog_facility = LOG_USER, bool enable_formatting = false)
{
return Factory::template create<sinks::syslog_sink_mt>(log…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ozcanay
Comment options

Answer selected by ozcanay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants