#include "common.h"
#include "plugin.h"
-#define DEFAULT_LOGFILE LOCALSTATEDIR "/log/collectd.log"
-
#if COLLECT_DEBUG
static int log_level = LOG_DEBUG;
#else
pthread_mutex_lock(&file_lock);
if (log_file == NULL) {
- fh = fopen(DEFAULT_LOGFILE, "a");
- do_close = 1;
+ fh = stderr;
} else if (strcasecmp(log_file, "stderr") == 0)
fh = stderr;
else if (strcasecmp(log_file, "stdout") == 0)
if (fh == NULL) {
char errbuf[1024];
- fprintf(stderr, "logfile plugin: fopen (%s) failed: %s\n",
- (log_file == NULL) ? DEFAULT_LOGFILE : log_file,
+ fprintf(stderr, "logfile plugin: fopen (%s) failed: %s\n", log_file,
sstrerror(errno, errbuf, sizeof(errbuf)));
} else {
if (print_timestamp)