diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-12-27 11:16:05 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-12-27 11:16:05 +0400 |
commit | ee41cba691ab9f6461f4933461cf82be161333de (patch) | |
tree | 52adb462650a2944fa0e7b667025a4f216fb5cce | |
parent | c8bc8763ea6980ef3e3fa7e3dbe2a598a1169de5 (diff) | |
download | accel-ppp-ee41cba691ab9f6461f4933461cf82be161333de.tar.gz accel-ppp-ee41cba691ab9f6461f4933461cf82be161333de.zip |
implemented logging to system logger
-rw-r--r-- | accel-pppd/accel-ppp.conf | 3 | ||||
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 4 | ||||
-rw-r--r-- | accel-pppd/logs/CMakeLists.txt | 38 | ||||
-rw-r--r-- | accel-pppd/triton/triton.c | 1 |
4 files changed, 39 insertions, 7 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf index 8ec82124..1903d946 100644 --- a/accel-pppd/accel-ppp.conf +++ b/accel-pppd/accel-ppp.conf @@ -1,6 +1,7 @@ [modules] #path=/usr/local/lib/accel-ppp log_file +#log_syslog #log_tcp #log_pgsql pptp @@ -108,6 +109,7 @@ log-file=/var/log/accel-ppp/accel-ppp.log log-emerg=/var/log/accel-ppp/emerg.log log-fail-file=/var/log/accel-ppp/auth-fail.log #log-debug=/dev/stdout +#syslog=accel-pppd,daemon #log-tcp=127.0.0.1:3000 copy=1 #color=1 @@ -115,7 +117,6 @@ copy=1 #per-session-dir=per_session #per-session=1 level=3 -#log-tcp=127.0.0.1:3000 [log-pgsql] conninfo=user=log diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 85648a44..0e241a27 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -363,6 +363,10 @@ Path to file to write authentication failed session log. .BI "log-tcp=" x.x.x.x:port Send logs to specified host. .TP +.BI "syslog=" ident[,facility] +Send logs to system logger. +Facility may be: daemon, local0-local7 or numeric value. +.TP .BI "copy=" n If this options is given and greater then zero logging engine will duplicate session log in general log. (Useful when per-session/per-user logs are not used) diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt index ce909b67..b10163f4 100644 --- a/accel-pppd/logs/CMakeLists.txt +++ b/accel-pppd/logs/CMakeLists.txt @@ -1,11 +1,37 @@ -ADD_LIBRARY(log_file SHARED log_file.c) -TARGET_LINK_LIBRARIES(log_file rt) +IF(NOT DEFINED LOG_FILE) + SET(LOG_FILE TRUE) +ENDIF(NOT DEFINED LOG_FILE) -ADD_LIBRARY(log_tcp SHARED log_tcp.c) +IF(NOT DEFINED LOG_TCP) + SET(LOG_TCP TRUE) +ENDIF(NOT DEFINED LOG_TCP) -INSTALL(TARGETS log_file log_tcp - LIBRARY DESTINATION lib/accel-ppp -) +IF(NOT DEFINED LOG_SYSLOG) + SET(LOG_SYSLOG TRUE) +ENDIF(NOT DEFINED LOG_SYSLOG) + + +IF(LOG_FILE) + ADD_LIBRARY(log_file SHARED log_file.c) + TARGET_LINK_LIBRARIES(log_file rt) + INSTALL(TARGETS log_file + LIBRARY DESTINATION lib/accel-ppp + ) +ENDIF(LOG_FILE) + +IF(LOG_TCP) + ADD_LIBRARY(log_tcp SHARED log_tcp.c) + INSTALL(TARGETS log_tcp + LIBRARY DESTINATION lib/accel-ppp + ) +ENDIF(LOG_TCP) + +IF(LOG_SYSLOG) + ADD_LIBRARY(log_syslog SHARED log_syslog.c) + INSTALL(TARGETS log_syslog + LIBRARY DESTINATION lib/accel-ppp + ) +ENDIF(LOG_SYSLOG) IF(LOG_PGSQL) ADD_LIBRARY(log_pgsql SHARED log_pgsql.c) diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c index 97c277a5..4e3e75a4 100644 --- a/accel-pppd/triton/triton.c +++ b/accel-pppd/triton/triton.c @@ -171,6 +171,7 @@ cont: if (thread->ctx->need_free) { log_debug2("- context %p removed\n", thread->ctx); + thread->ctx->ud->tpd = NULL; mempool_free(thread->ctx); } |