PostgreSQL Source Code
git master
|
#include <limits.h>
Go to the source code of this file.
Data Structures | |
struct | PipeProtoHeader |
union | PipeProtoChunk |
Macros | |
#define | PIPE_CHUNK_SIZE 512 |
#define | PIPE_HEADER_SIZE offsetof(PipeProtoHeader, data) |
#define | PIPE_MAX_PAYLOAD ((int) (PIPE_CHUNK_SIZE - PIPE_HEADER_SIZE)) |
#define | PIPE_PROTO_IS_LAST 0x01 /* last chunk of message? */ |
#define | PIPE_PROTO_DEST_STDERR 0x10 |
#define | PIPE_PROTO_DEST_CSVLOG 0x20 |
#define | PIPE_PROTO_DEST_JSONLOG 0x40 |
#define | LOG_METAINFO_DATAFILE "current_logfiles" |
#define | LOG_METAINFO_DATAFILE_TMP LOG_METAINFO_DATAFILE ".tmp" |
Functions | |
int | SysLogger_Start (int child_slot) |
void | write_syslogger_file (const char *buffer, int count, int destination) |
void | SysLoggerMain (char *startup_data, size_t startup_data_len) pg_attribute_noreturn() |
bool | CheckLogrotateSignal (void) |
void | RemoveLogrotateSignalFiles (void) |
Variables | |
PGDLLIMPORT bool | Logging_collector |
PGDLLIMPORT int | Log_RotationAge |
PGDLLIMPORT int | Log_RotationSize |
PGDLLIMPORT char * | Log_directory |
PGDLLIMPORT char * | Log_filename |
PGDLLIMPORT bool | Log_truncate_on_rotation |
PGDLLIMPORT int | Log_file_mode |
PGDLLIMPORT int | syslogPipe [2] |
#define LOG_METAINFO_DATAFILE "current_logfiles" |
Definition at line 102 of file syslogger.h.
#define LOG_METAINFO_DATAFILE_TMP LOG_METAINFO_DATAFILE ".tmp" |
Definition at line 103 of file syslogger.h.
#define PIPE_CHUNK_SIZE 512 |
Definition at line 41 of file syslogger.h.
#define PIPE_HEADER_SIZE offsetof(PipeProtoHeader, data) |
Definition at line 59 of file syslogger.h.
#define PIPE_MAX_PAYLOAD ((int) (PIPE_CHUNK_SIZE - PIPE_HEADER_SIZE)) |
Definition at line 60 of file syslogger.h.
#define PIPE_PROTO_DEST_CSVLOG 0x20 |
Definition at line 66 of file syslogger.h.
#define PIPE_PROTO_DEST_JSONLOG 0x40 |
Definition at line 67 of file syslogger.h.
#define PIPE_PROTO_DEST_STDERR 0x10 |
Definition at line 65 of file syslogger.h.
#define PIPE_PROTO_IS_LAST 0x01 /* last chunk of message? */ |
Definition at line 63 of file syslogger.h.
bool CheckLogrotateSignal | ( | void | ) |
Definition at line 1572 of file syslogger.c.
References LOGROTATE_SIGNAL_FILE, and stat.
Referenced by process_pm_pmsignal().
void RemoveLogrotateSignalFiles | ( | void | ) |
Definition at line 1586 of file syslogger.c.
References LOGROTATE_SIGNAL_FILE.
Referenced by PostmasterMain(), and process_pm_pmsignal().
int SysLogger_Start | ( | int | child_slot | ) |
Definition at line 593 of file syslogger.c.
References Assert, B_LOGGER, close, csvlogFile, SysloggerStartupData::csvlogFile, ereport, errcode_for_file_access(), errcode_for_socket_access(), errhint(), errmsg(), FATAL, fd(), fflush(), filename, first_syslogger_file_time, jsonlogFile, SysloggerStartupData::jsonlogFile, LOG, Log_destination, LOG_DESTINATION_CSVLOG, LOG_DESTINATION_JSONLOG, Log_directory, logfile_getname(), logfile_open(), Logging_collector, MakePGDirectory(), pfree(), postmaster_child_launch(), redirection_done, STDERR_FILENO, generate_unaccent_rules::stdout, STDOUT_FILENO, syslogFile, SysloggerStartupData::syslogFile, and syslogPipe.
Referenced by StartSysLogger().
void SysLoggerMain | ( | char * | startup_data, |
size_t | startup_data_len | ||
) |
Definition at line 165 of file syslogger.c.
References AddWaitEventToSet(), Assert, B_LOGGER, close, ConfigReloadPending, CreateWaitEventSet(), csvlogFile, SysloggerStartupData::csvlogFile, DEBUG1, DestNone, DEVNULL, EINTR, elog, ereport, errcode_for_socket_access(), errmsg(), errmsg_internal(), WaitEvent::events, FATAL, fd(), first_syslogger_file_time, flush_pipe_input(), init_ps_display(), jsonlogFile, SysloggerStartupData::jsonlogFile, last_csv_file_name, last_json_file_name, last_sys_file_name, LOG, Log_destination, LOG_DESTINATION_CSVLOG, LOG_DESTINATION_JSONLOG, LOG_DESTINATION_STDERR, Log_directory, Log_filename, Log_RotationAge, Log_RotationSize, logfile_getname(), logfile_rotate(), MakePGDirectory(), MemoryContextDelete(), MyBackendType, MyLatch, MyStartTime, next_rotation_time, now(), pfree(), PGC_SIGHUP, PGINVALID_SOCKET, pipe_eof_seen, PostmasterContext, pqsignal(), proc_exit(), process_pipe_input(), ProcessConfigFile(), pstrdup(), read, READ_BUF_SIZE, redirection_done, ResetLatch(), rotation_disabled, rotation_requested, set_next_rotation_time(), SIG_DFL, SIG_IGN, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SIGPIPE, SIGQUIT, SIGUSR1, sigUsr1Handler(), SIGUSR2, STDERR_FILENO, STDOUT_FILENO, syslogFile, SysloggerStartupData::syslogFile, syslogPipe, UnBlockSig, update_metainfo_datafile(), WaitEventSetWait(), whereToSendOutput, WL_LATCH_SET, and WL_SOCKET_READABLE.
void write_syslogger_file | ( | const char * | buffer, |
int | count, | ||
int | destination | ||
) |
Definition at line 1093 of file syslogger.c.
References csvlogFile, jsonlogFile, LOG_DESTINATION_CSVLOG, LOG_DESTINATION_JSONLOG, logfile, syslogFile, and write_stderr.
Referenced by flush_pipe_input(), process_pipe_input(), send_message_to_server_log(), write_csvlog(), and write_jsonlog().
|
extern |
Definition at line 73 of file syslogger.c.
Referenced by convert_and_check_filename(), logfile_getname(), pg_ls_logdir(), SysLogger_Start(), and SysLoggerMain().
|
extern |
Definition at line 76 of file syslogger.c.
Referenced by logfile_open(), and show_log_file_mode().
|
extern |
Definition at line 74 of file syslogger.c.
Referenced by logfile_getname(), and SysLoggerMain().
|
extern |
Definition at line 71 of file syslogger.c.
Referenced by set_next_rotation_time(), and SysLoggerMain().
|
extern |
Definition at line 72 of file syslogger.c.
Referenced by SysLoggerMain().
|
extern |
Definition at line 75 of file syslogger.c.
Referenced by logfile_rotate_dest().
|
extern |
Definition at line 70 of file syslogger.c.
Referenced by LaunchMissingBackgroundProcesses(), pg_rotate_logfile(), PostmasterMain(), process_pm_child_exit(), and SysLogger_Start().
|
extern |
Definition at line 114 of file syslogger.c.
Referenced by ClosePostmasterPorts(), SysLogger_Start(), and SysLoggerMain().