Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7380b638
Commit
7380b638
authored
Feb 24, 2009
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't append epoch to log_filename if no format specifier is given.
Robert Haas
parent
7babccb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
21 deletions
+16
-21
doc/src/sgml/config.sgml
doc/src/sgml/config.sgml
+12
-8
src/backend/postmaster/syslogger.c
src/backend/postmaster/syslogger.c
+4
-13
No files found.
doc/src/sgml/config.sgml
View file @
7380b638
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.2
09 2009/02/22 23:50:30 tgl
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.2
10 2009/02/24 12:09:08 petere
Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
...
...
@@ -2398,16 +2398,20 @@ local0.* /var/log/postgresql
so <literal>%</literal>-escapes can be used to specify time-varying
file names. (Note that if there are
any time-zone-dependent <literal>%</literal>-escapes, the computation
is done in the zone specified by <xref linkend="guc-log-timezone">.)
If no <literal>%</literal>-escapes are present,
<productname>PostgreSQL</productname> will append the epoch of the new
log file's creation time. For example, if
<varname>log_filename</varname> were <literal>server_log</literal>,
then the chosen file name would be <literal>server_log.1093827753</>
for a log starting at Sun Aug 29 19:02:33 2004 MST.
is done in the zone specified
by <xref linkend="guc-log-timezone">.)
Note that the system's <systemitem>strftime</systemitem> is not used
directly, so platform-specific (nonstandard) extensions do not work.
</para>
<para>
If you specify a file name without escapes, you should plan to
use a log rotation utility to avoid eventually filling the
entire disk. In releases prior to 8.4, if
no <literal>%</literal> escapes were
present, <productname>PostgreSQL</productname> would append
the epoch of the new log file's creation time, but this is no
longer the case.
</para>
<para>
If CSV-format output is enabled in <varname>log_destination</>,
<literal>.csv</> will be appended to the timestamped
...
...
src/backend/postmaster/syslogger.c
View file @
7380b638
...
...
@@ -18,7 +18,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.4
8 2009/02/03 00:59:26 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.4
9 2009/02/24 12:09:09 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1191,18 +1191,9 @@ logfile_getname(pg_time_t timestamp, char *suffix)
len
=
strlen
(
filename
);
if
(
strchr
(
Log_filename
,
'%'
))
{
/* treat it as a strftime pattern */
pg_strftime
(
filename
+
len
,
MAXPGPATH
-
len
,
Log_filename
,
pg_localtime
(
&
timestamp
,
log_timezone
));
}
else
{
/* no strftime escapes, so append timestamp to new filename */
snprintf
(
filename
+
len
,
MAXPGPATH
-
len
,
"%s.%lu"
,
Log_filename
,
(
unsigned
long
)
timestamp
);
}
/* treat it as a strftime pattern */
pg_strftime
(
filename
+
len
,
MAXPGPATH
-
len
,
Log_filename
,
pg_localtime
(
&
timestamp
,
log_timezone
));
if
(
suffix
!=
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment