log_filename

Started by bastiover 8 years ago6 messagesgeneral
Jump to latest
#1basti
mailinglist@unix-solution.de

Hello,
in my postgres.conf i use

log_filename = 'postgresql-%Y-%m-%d.log'
this results in Logfiles named "postgresql-2017-07-14.log"

Is there a way to create logfiles
"postgresql-<version_number>-2017-07-14.log"

Best Regards,
Basti

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Ahtesham Karajgi
ahteshamkarajgi@gmail.com
In reply to: basti (#1)
Re: log_filename

Add the version in the log_filename itself.

Below is the test case.

naveed=# show log_filename ;
log_filename
--------------------------------
postgresql-%Y-%m-%d_%H%M%S.log
(1 row)

naveed=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)

naveed=# show log_filename ;
log_filename
------------------------------------
postgresql-9.5-%Y-%m-%d_%H%M%S.log
(1 row)

test=# \q
[postgres@localhost ~]$
[postgres@localhost ~]$ ls -lrth /usr/local/pgsql/data/pg_log | tail -2
-rw-------. 1 postgres postgres 3.3K Jul 18 01:25
postgresql-2017-07-18_000000.log
-rw-------. 1 postgres postgres 4.1K Jul 18 01:27
postgresql-9.5-2017-07-18_012530.log
[postgres@localhost ~]$

On Tue, Jul 18, 2017 at 1:50 PM, basti <mailinglist@unix-solution.de> wrote:

Show quoted text

Hello,
in my postgres.conf i use

log_filename = 'postgresql-%Y-%m-%d.log'
this results in Logfiles named "postgresql-2017-07-14.log"

Is there a way to create logfiles
"postgresql-<version_number>-2017-07-14.log"

Best Regards,
Basti

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3wambacher
wnordmann@gmx.de
In reply to: Ahtesham Karajgi (#2)
Re: log_filename

May be i'm blind: what did you really do? changed postgresql.conf?

regards
walter

Am 18.07.2017 um 10:31 schrieb Ahtesham Karajgi:

Add the version in the log_filename itself.

Below is the test case.

naveed=# show log_filename ;
log_filename
--------------------------------
postgresql-%Y-%m-%d_%H%M%S.log
(1 row)

naveed=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)

naveed=# show log_filename ;
log_filename
------------------------------------
postgresql-9.5-%Y-%m-%d_%H%M%S.log
(1 row)

test=# \q
[postgres@localhost ~]$
[postgres@localhost ~]$ ls -lrth /usr/local/pgsql/data/pg_log | tail -2
-rw-------. 1 postgres postgres 3.3K Jul 18 01:25
postgresql-2017-07-18_000000.log
-rw-------. 1 postgres postgres 4.1K Jul 18 01:27
postgresql-9.5-2017-07-18_012530.log
[postgres@localhost ~]$

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Achilleas Mantzios
achill@matrix.gatewaynet.com
In reply to: wambacher (#3)
Re: log_filename

On 18/07/2017 11:36, Walter Nordmann wrote:

May be i'm blind: what did you really do? changed postgresql.conf?

He hardcoded it in the postgresql.conf .

regards
walter

Am 18.07.2017 um 10:31 schrieb Ahtesham Karajgi:

Add the version in the log_filename itself.

Below is the test case.

naveed=# show log_filename ;
log_filename
--------------------------------
postgresql-%Y-%m-%d_%H%M%S.log
(1 row)

naveed=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)

naveed=# show log_filename ;
log_filename
------------------------------------
postgresql-9.5-%Y-%m-%d_%H%M%S.log
(1 row)

test=# \q
[postgres@localhost ~]$
[postgres@localhost ~]$ ls -lrth /usr/local/pgsql/data/pg_log | tail -2
-rw-------. 1 postgres postgres 3.3K Jul 18 01:25 postgresql-2017-07-18_000000.log
-rw-------. 1 postgres postgres 4.1K Jul 18 01:27 postgresql-9.5-2017-07-18_012530.log
[postgres@localhost ~]$

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5basti
basti@unix-solution.de
In reply to: Achilleas Mantzios (#4)
Re: log_filename

I want to create a generic own_postgres.conf and include that in
postgres.conf

I ask a bit wrong. Is there a variable to include postgres version on
log_filename?

Best regards
basti

Am 18.07.2017 um 10:40 schrieb Achilleas Mantzios:

On 18/07/2017 11:36, Walter Nordmann wrote:

May be i'm blind: what did you really do? changed postgresql.conf?

He hardcoded it in the postgresql.conf .

regards
walter

Am 18.07.2017 um 10:31 schrieb Ahtesham Karajgi:

Add the version in the log_filename itself.

Below is the test case.

naveed=# show log_filename ;
log_filename
--------------------------------
postgresql-%Y-%m-%d_%H%M%S.log
(1 row)

naveed=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)

naveed=# show log_filename ;
log_filename
------------------------------------
postgresql-9.5-%Y-%m-%d_%H%M%S.log
(1 row)

test=# \q
[postgres@localhost ~]$
[postgres@localhost ~]$ ls -lrth /usr/local/pgsql/data/pg_log | tail -2
-rw-------. 1 postgres postgres 3.3K Jul 18 01:25
postgresql-2017-07-18_000000.log
-rw-------. 1 postgres postgres 4.1K Jul 18 01:27
postgresql-9.5-2017-07-18_012530.log
[postgres@localhost ~]$

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6basti
mailinglist@unix-solution.de
In reply to: Achilleas Mantzios (#4)
Re: log_filename

I want to create a generic own_postgres.conf and include that in
postgres.conf

I ask a bit wrong. Is there a variable to include postgres version on
log_filename?

Best regards
basti

Am 18.07.2017 um 10:40 schrieb Achilleas Mantzios:

On 18/07/2017 11:36, Walter Nordmann wrote:

May be i'm blind: what did you really do? changed postgresql.conf?

He hardcoded it in the postgresql.conf .

regards
walter

Am 18.07.2017 um 10:31 schrieb Ahtesham Karajgi:

Add the version in the log_filename itself.

Below is the test case.

naveed=# show log_filename ;
log_filename
--------------------------------
postgresql-%Y-%m-%d_%H%M%S.log
(1 row)

naveed=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)

naveed=# show log_filename ;
log_filename
------------------------------------
postgresql-9.5-%Y-%m-%d_%H%M%S.log
(1 row)

test=# \q
[postgres@localhost ~]$
[postgres@localhost ~]$ ls -lrth /usr/local/pgsql/data/pg_log | tail -2
-rw-------. 1 postgres postgres 3.3K Jul 18 01:25
postgresql-2017-07-18_000000.log
-rw-------. 1 postgres postgres 4.1K Jul 18 01:27
postgresql-9.5-2017-07-18_012530.log
[postgres@localhost ~]$

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general