简体   繁体   中英

Log file is changed automaticaly - PostgreSQL

I am starting PostgreSQL 11 Server with command line on Windows and I am trying to give the log file parameter, however when I start the server the log file is being changed to the default one that is assigned in the postgresql.conf with log_directory and log_filename settings.

I tried to delete the log_directory and log_filename data from postgresql.conf file, but it didn't work the log file is still being changed to the default one that was given in the old log_directory and log_filename values.

I am stoping the server every time to get the new data updated, and I am starting it with this command line:

"C:\Program Files\PostgreSQL11\bin\pg_ctl.exe" -D "C:\Program Files\PostgreSQL11\data\pg11" -w -o "-F -p 5423" -l "C:\Program Files\PostgreSQL11\data\logs\pg11\MY_LOG_FILE.log" start

I get this log message in my log file and after that the log messages will be saved in the old default log file:

2019-07-30 11:18:00 CEST [19996]: [4-1] user=,db=,app=,client= TIPP: The further log output will appear in the directory »C:/PROGRA~1/POSTGR~2/data/logs/pg11«

It is mentioned in the documentation:

pg_ctl encapsulates tasks such as redirecting log output and properly detaching from the terminal and process group.

However, since nobody is having any idea about this issue, it looks like there is a difference between the log file that is passed to the executable and the log file from the postgresql.conf , the one that is passed to the executable is just to log data from the executable while it is starting the server, the other one from the config file is to log data from inside the server like when you execute a query, so the result that I have had makes sense now, and what I got is actually the normal behavior, but in this case the documentation should be fixed.

If this is not the case, and the pg_ctl should really redirect the server log output then this is a bug in PostgreSQL 11.4 , just for you guys to know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM