Re: serverlog rotation/functions - Mailing list pgsql-patches

From Andreas Pflug
Subject Re: serverlog rotation/functions
Date
Msg-id 40F58511.7070508@pse-consulting.de
Whole thread Raw
In response to Re: serverlog rotation/functions  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian wrote:
>
> Also there are no documenttion changes.

Here are the missing docs, freshly created against cvs.

Regards,
Andreas

Index: func.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/func.sgml,v
retrieving revision 1.214
diff -u -r1.214 func.sgml
--- func.sgml    12 Jul 2004 20:23:47 -0000    1.214
+++ func.sgml    14 Jul 2004 19:08:16 -0000
@@ -7455,6 +7455,80 @@
    </para>

    <indexterm zone="functions-misc">
+   <primary>pg_logfile_get</primary>
+   </indexterm>
+   <indexterm zone="functions-misc">
+   <primary>pg_logfile_length</primary>
+   </indexterm>
+   <indexterm zone="functions-misc">
+   <primary>pg_logfile_name</primary>
+   </indexterm>
+   <indexterm zone="functions-misc">
+   <primary>pg_logfile_rotate</primary>
+   </indexterm>
+   <para>
+    The functions shown in <xref linkend="functions-misc-logfile">
+    deal with the server log file if configured with log_destination
+    <quote>file</quote>.
+   </para>
+
+   <table id="functions-misc-logfile">
+    <title>Server Logfile Functions</title>
+    <tgroup cols="3">
+     <thead>
+      <row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry></row>
+     </thead>
+
+     <tbody>
+      <row>
+       <entry><literal><function>pg_logfile_get</function>(<parameter>size_int4</parameter>,
+       <parameter>offset_int4</parameter>,<parameter>filename_text</parameter>)</literal></entry>
+       <entry><type>cstring</type></entry>
+       <entry>get a part of the current server log file</entry>
+      </row>
+      <row>
+       <entry><literal><function>pg_logfile_length</function>(<paramater>filename_text</parameter>)</literal></entry>
+       <entry><type>int4</type></entry>
+       <entry>return the current length of the server log file</entry>
+      </row>
+      <row>
+       <entry><literal><function>pg_logfile_rotate</function>()</literal></entry>
+       <entry><type>cstring</type></entry>
+       <entry>rotates the server log file and returns the new log file
+       name</entry>
+      </row>
+      <row>
+       <entry><literal><function>pg_logfile_name</function>()</literal></entry>
+       <entry><type>cstring</type></entry>
+       <entry>returns the current server log file name</entry>
+      </row>
+      <row>
+       <entry><literal><function>pg_logfile_rotate</function>()</literal></entry>
+       <entry><type>cstring</type></entry>
+       <entry>rotates the server log file and returns the previous log file
+       name</entry>
+      </row>
+      </tbody>
+</tgroup>
+</table>
+<para>
+The <function>pg_logfile_get</function> function will return the
+       contents of the current server log file, limited by the size
+       parameter. If size is NULL, a server internal limit (currently
+       50000) is applied. The position parameter specifies the
+       starting position of the server log chunk to be returned. A
+       positive number or 0 will be counted from the start of the file,
+       a negative number from the end; if NULL, -size is assumed
+       (i.e. the tail of the log file).
+</para>
+<para>
+Both <function>pg_logfile_get</function> and
+       <function>pg_logfile_length</function> have a filename
+       parameter which may specify the logfile to examine or the
+       current logfile if NULL.
+</para>
+
+   <indexterm zone="functions-misc">
     <primary>pg_cancel_backend</primary>
    </indexterm>

Index: runtime.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/runtime.sgml,v
retrieving revision 1.269
diff -u -r1.269 runtime.sgml
--- runtime.sgml    11 Jul 2004 00:18:40 -0000    1.269
+++ runtime.sgml    14 Jul 2004 19:08:26 -0000
@@ -1769,9 +1769,9 @@
       <listitem>
        <para>
     <productname>PostgreSQL</productname> supports several methods
-     for loggning, including <systemitem>stderr</systemitem> and
-     <systemitem>syslog</systemitem>. On Windows,
-     <systemitem>eventlog</systemitem> is also supported. Set this
+     for logging, including <systemitem>stderr</systemitem>,
+     <systemitem>file></systemitem> and <systemitem>syslog</systemitem>.
+      On Windows, <systemitem>eventlog</systemitem> is also supported. Set this
      option to a list of desired log destinations separated by a
      comma. The default is to log to <systemitem>stderr</systemitem>
      only. This option must be set at server start.
@@ -1779,6 +1779,17 @@
       </listitem>
      </varlistentry>

+     <varlistentry id="guc-syslog-facility" xreflabel="log_filename">
+      <term><varname>log_filename</varname> (<type>string</type>)</term>
+       <listitem>
+        <para>
+          This option sets the target filename for the log destination
+          <quote>file</quote> option. It may be specified as absolute
+          path or relative to the <application>cluster directory</application>.
+        </para>
+       </listitem>
+     </varlistentry>
+
      <varlistentry id="guc-syslog-facility" xreflabel="syslog_facility">
       <term><varname>syslog_facility</varname> (<type>string</type>)</term>
        <listitem>

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: [subxacts] Savepoint syntax
Next
From: "Magnus Hagander"
Date:
Subject: plperl win32