summaryrefslogtreecommitdiff
path: root/src/include/postmaster/syslogger.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-03 11:32:45 +0530
committerRobert Haas <rhaas@postgresql.org>2017-03-03 11:43:11 +0530
commit19dc233c32f2900e57b8da4f41c0f662ab42e080 (patch)
treefa58ea33507a0b5d09167e4d4d586b60965f7855 /src/include/postmaster/syslogger.h
parentaea5d298362e881b13d95a48c5ae116879237389 (diff)
Add pg_current_logfile() function.
The syslogger will write out the current stderr and csvlog names, if it's running and there are any, to a new file in the data directory called "current_logfiles". We take care to remove this file when it might no longer be valid (but not at shutdown). The function pg_current_logfile() can be used to read the entries in the file. Gilles Darold, reviewed and modified by Karl O. Pinc, Michael Paquier, and me. Further review by Álvaro Herrera and Christoph Berg.
Diffstat (limited to 'src/include/postmaster/syslogger.h')
-rw-r--r--src/include/postmaster/syslogger.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index c187a5f23ed..94d7eac347f 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -87,4 +87,11 @@ extern void write_syslogger_file(const char *buffer, int count, int dest);
extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif
+/*
+ * Name of files saving meta-data information about the log
+ * files currently in use by the syslogger
+ */
+#define LOG_METAINFO_DATAFILE "current_logfiles"
+#define LOG_METAINFO_DATAFILE_TMP LOG_METAINFO_DATAFILE ".tmp"
+
#endif /* _SYSLOGGER_H */