From 7ae9a74c9c3bdab619ac5c0cefe1c8269bb06603 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 24 Sep 2009 00:16:53 +0200 Subject: Rewritten the eurephia_log() to support syslog logging as well Also simplified the initialisation of the logging module. By calling the eurephia_log_init(eurephiaCTX *, char *dest, int loglevel) function, a log context will be setup inside the eurephiaCTX. To close the log file, eurephia_log_close(eurephiaCTX *) must be called. The destination string to eurephia_log_init() can be: - stdout: Log everything to stdout - stderr: Log everything to stderr - none: Do no logging at all - syslog: Log via syslog. can be: user, local[0-7], daemon or authpriv. - Filename All logging goes to the given filename. If the filename string is not recognised by any of the reserved words above, it will be handled as a filename. --- plugin/eurephia-auth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugin/eurephia-auth.c') diff --git a/plugin/eurephia-auth.c b/plugin/eurephia-auth.c index 3536281..10d9447 100644 --- a/plugin/eurephia-auth.c +++ b/plugin/eurephia-auth.c @@ -189,9 +189,9 @@ OPENVPN_EXPORT int openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, DEBUG(ctx, 10, "openvpn_plugin_func_v1(ctx, %s, ...)", plugin_type_name(type)); #ifdef ENABLE_DEBUG - if( ctx->loglevel >= 30 ) { - dump_env(ctx->log, "ENV: ", envp); - dump_env(ctx->log, "ARG: ", argv); + if( (ctx->log->loglevel >= 30) && (ctx->log->logfile != NULL) ) { + dump_env(ctx->log->logfile, "ENV: ", envp); + dump_env(ctx->log->logfile, "ARG: ", argv); } #endif -- cgit