// If conf->log_file was specified, that takes the highest priority
if (!conf->log_file.empty()) {
string log_file(normalize_relative(conf->log_file.c_str()));
- if (conf->log_per_instance) {
+ if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
ostringstream oss;
oss << log_file << "." << getpid();
return oss.str();
else
log_dir = normalize_relative(conf->log_dir.c_str());
- if (conf->log_per_instance) {
+ if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
char hostname[255];
memset(hostname, 0, sizeof(hostname));
int ret = gethostname(hostname, sizeof(hostname));
symlink_dir = _get_symlink_dir(conf);
- if (conf->log_per_instance) {
+ if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
// Calculate instance symlink path (isym_path)
ostringstream iss;
iss << symlink_dir << "/" << conf->name.to_str();
conf->parse_argv(args); // argv override
- if (code_env != CODE_ENVIRONMENT_DAEMON) {
- // The symlink stuff only really makes sense for daemons
- conf->log_per_instance = false;
- }
-
// Expand metavariables. Invoke configuration observers.
conf->apply_changes();