You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-17 07:22:20 +02:00
Disable logging to file in agent
This commit is contained in:
@ -268,15 +268,23 @@ FILE* fio_fopen(char const* path, char const* mode, fio_location location)
|
|||||||
FILE* f;
|
FILE* f;
|
||||||
if (fio_is_remote(location))
|
if (fio_is_remote(location))
|
||||||
{
|
{
|
||||||
int flags = O_RDWR|O_CREAT|PG_BINARY|(strchr(mode, '+') ? 0 : O_TRUNC);
|
int flags = O_RDWR|O_CREAT;
|
||||||
int fd = fio_open(path, flags, location);
|
int fd;
|
||||||
|
if (strcmp(mode, PG_BINARY_W) == 0) {
|
||||||
|
flags |= O_TRUNC|PG_BINARY;
|
||||||
|
} else if (strncmp(mode, PG_BINARY_R, strlen(PG_BINARY_R)) == 0) {
|
||||||
|
flags |= PG_BINARY;
|
||||||
|
} else if (strcmp(mode, "a") == 0) {
|
||||||
|
flags |= O_APPEND;
|
||||||
|
}
|
||||||
|
fd = fio_open(path, flags, location);
|
||||||
f = (FILE*)(size_t)((fd + 1) & ~FIO_PIPE_MARKER);
|
f = (FILE*)(size_t)((fd + 1) & ~FIO_PIPE_MARKER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f = fopen(path, mode);
|
f = fopen(path, mode);
|
||||||
if (f == NULL && strcmp(mode, PG_BINARY_R "+") == 0)
|
if (f == NULL && strcmp(mode, PG_BINARY_R "+") == 0)
|
||||||
f = fopen(path, PG_BINARY_W);
|
f = fopen(path, PG_BINARY_W);
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -157,8 +157,10 @@ elog_internal(int elevel, bool file_only, const char *message)
|
|||||||
time_t log_time = (time_t) time(NULL);
|
time_t log_time = (time_t) time(NULL);
|
||||||
char strfbuf[128];
|
char strfbuf[128];
|
||||||
|
|
||||||
write_to_file = elevel >= logger_config.log_level_file &&
|
write_to_file = elevel >= logger_config.log_level_file
|
||||||
logger_config.log_directory && logger_config.log_directory[0] != '\0';
|
&& logger_config.log_directory
|
||||||
|
&& logger_config.log_directory[0] != '\0'
|
||||||
|
&& !remote_agent;
|
||||||
write_to_error_log = elevel >= ERROR && logger_config.error_log_filename &&
|
write_to_error_log = elevel >= ERROR && logger_config.error_log_filename &&
|
||||||
logger_config.log_directory && logger_config.log_directory[0] != '\0';
|
logger_config.log_directory && logger_config.log_directory[0] != '\0';
|
||||||
write_to_stderr = elevel >= (remote_agent ? ERROR : logger_config.log_level_console) && !file_only;
|
write_to_stderr = elevel >= (remote_agent ? ERROR : logger_config.log_level_console) && !file_only;
|
||||||
|
Reference in New Issue
Block a user