Skip to content

Commit

Permalink
Do not try to log in /var/log for source installation
Browse files Browse the repository at this point in the history
Fix #478
  • Loading branch information
remh committed May 2, 2013
1 parent 53db96e commit c26fe5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,11 @@ def get_logging_config(cfg_path=None):
except:
logging_config['syslog_port'] = None

if config.has_option('Main', 'disable_file_logging'):
logging_config['disable_file_logging'] = config.get('Main', 'disable_file_logging').strip().lower() in ['yes', 'true', 1]
else:
logging_config['disable_file_logging'] = False

return logging_config


Expand All @@ -762,7 +767,7 @@ def initialize_logging(logger_name):

# set up file loggers
log_file = logging_config.get('%s_log_file' % logger_name)
if log_file is not None:
if log_file is not None and not logging_config['disable_file_logging']:
# make sure the log directory is writeable
# NOTE: the entire directory needs to be writable so that rotation works
if os.access(os.path.dirname(log_file), os.R_OK | os.W_OK):
Expand Down
4 changes: 3 additions & 1 deletion packaging/datadog-agent/source/setup_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ else
sed "s/api_key:.*/api_key: pup/" $dd_base/agent/datadog.conf.example > $dd_base/agent/datadog.conf.1 2>> $logfile
fi
sed "s/# use_pup:.*/use_pup: yes/" $dd_base/agent/datadog.conf.1 > $dd_base/agent/datadog.conf 2>> $logfile
printf "disable_file_logging: True" >> $dd_base/agent/datadog.conf

print_done

printf "Setting up launching scripts....."
printf "Setting up launching scripts....." | tee -a $logfile
mkdir -p $dd_base/bin >> $logfile 2>&1
cp $dd_base/agent/packaging/datadog-agent/source/agent $dd_base/bin/agent >> $logfile 2>&1
cp $dd_base/agent/packaging/datadog-agent/source/info $dd_base/bin/info >> $logfile 2>&1
Expand Down

0 comments on commit c26fe5d

Please sign in to comment.