summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2015-09-30 17:54:56 +0200
committerNick Mathewson <nickm@torproject.org>2015-09-30 18:34:15 +0200
commit1cf0d82280973a52403c160fa47a4fb06dfca6c3 (patch)
treec22b791c38b3cb06d7abe7186d5839bc7fabf792 /src/or/config.c
parent0d43a54d1c9c1be24c33eed79029d1bd44a6a28a (diff)
downloadtor-1cf0d82280973a52403c160fa47a4fb06dfca6c3.tar.gz
tor-1cf0d82280973a52403c160fa47a4fb06dfca6c3.zip
Add SyslogIdentityTag
When logging to syslog, allow a tag to be added to the syslog identity ("Tor"), i.e. the string prepended to every log message. The tag can be configured by setting SyslogIdentityTag and defaults to none. Setting it to "foo" will cause logs to be tagged as "Tor-foo". Closes: #17194.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index fa860af337..9b65addeeb 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -312,6 +312,7 @@ static config_var_t option_vars_[] = {
V(LogMessageDomains, BOOL, "0"),
V(LogTimeGranularity, MSEC_INTERVAL, "1 second"),
V(TruncateLogFile, BOOL, "0"),
+ V(SyslogIdentityTag, STRING, NULL),
V(LongLivedPorts, CSV,
"21,22,706,1863,5050,5190,5222,5223,6523,6667,6697,8300"),
VAR("MapAddress", LINELIST, AddressMap, NULL),
@@ -4937,7 +4938,7 @@ options_init_logs(const or_options_t *old_options, or_options_t *options,
!strcasecmp(smartlist_get(elts,0), "syslog")) {
#ifdef HAVE_SYSLOG_H
if (!validate_only) {
- add_syslog_log(severity);
+ add_syslog_log(severity, options->SyslogIdentityTag);
}
#else
log_warn(LD_CONFIG, "Syslog is not supported on this system. Sorry.");