Psql dosent log error messages on windows

Started by Armand Turpelalmost 14 years ago3 messagesgeneral
Jump to latest
#1Armand Turpel
armand.turpel.mnhn@gmail.com

When i execute a sql script trough psql, it shows me errors in the
console window but it dosent write this errors in a log file.

psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql

C:/test_files/pg.log

psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql
-o C:/test_files/pg.log

Configuration settings :
log_destination = 'stderr,eventlog,csvlog'
logging_collector = on
client_min_messages = notice
log_min_messages = warning

The server is started as :

pg_ctl.exe -l "C:/test_files/log/pg.log" -D "C:/pgsql_9_1_1/data" start

Also no error messages this log file.
But the errors are in the eventlog of windows.

Thanks for help.

#2Willy-Bas Loos
willybas@gmail.com
In reply to: Armand Turpel (#1)
Re: Psql dosent log error messages on windows

the windows user that owns the process ("postgres" by default) needs to
have the right to write in the folder to write a server log.
by default, this user has very few privileges (for good reasons - security).

about psql not writing that log:

means to redirect "standard out" to a file. But "standard error" is not

affected by that.
add 2>&1 to write errors to that log too.

hth,

WBL

On Wed, Apr 25, 2012 at 2:11 PM, Armand Turpel <armand.turpel.mnhn@gmail.com

wrote:

When i execute a sql script trough psql, it shows me errors in the console
window but it dosent write this errors in a log file.

psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql >>
C:/test_files/pg.log
psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql -o
C:/test_files/pg.log

Configuration settings :
log_destination = 'stderr,eventlog,csvlog'
logging_collector = on
client_min_messages = notice
log_min_messages = warning

The server is started as :

pg_ctl.exe -l "C:/test_files/log/pg.log" -D "C:/pgsql_9_1_1/data" start

Also no error messages this log file.
But the errors are in the eventlog of windows.

Thanks for help.

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

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

#3Willy-Bas Loos
willybas@gmail.com
In reply to: Willy-Bas Loos (#2)
Re: Psql dosent log error messages on windows

like so:
http://support.microsoft.com/kb/110930

On Wed, Apr 25, 2012 at 2:27 PM, Willy-Bas Loos <willybas@gmail.com> wrote:

the windows user that owns the process ("postgres" by default) needs to
have the right to write in the folder to write a server log.
by default, this user has very few privileges (for good reasons -
security).

about psql not writing that log:

means to redirect "standard out" to a file. But "standard error" is

not affected by that.
add 2>&1 to write errors to that log too.

hth,

WBL

On Wed, Apr 25, 2012 at 2:11 PM, Armand Turpel <
armand.turpel.mnhn@gmail.com> wrote:

When i execute a sql script trough psql, it shows me errors in the
console window but it dosent write this errors in a log file.

psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql

C:/test_files/pg.log

psql.exe -h localhost -d test -U postgres -w -f C:/test_files/test.sql
-o C:/test_files/pg.log

Configuration settings :
log_destination = 'stderr,eventlog,csvlog'
logging_collector = on
client_min_messages = notice
log_min_messages = warning

The server is started as :

pg_ctl.exe -l "C:/test_files/log/pg.log" -D "C:/pgsql_9_1_1/data" start

Also no error messages this log file.
But the errors are in the eventlog of windows.

Thanks for help.

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

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth