Difference between revisions of "Diag/scalixdb"

From Scalix Wiki
Jump to: navigation, search
m (Configure enhanced Postgresql logging)
m (Configure enhanced Postgresql logging)
Line 28: Line 28:
 
Note that because the Postgresql package is inherited from the operating system distribution, and changes may occur in this file between revisions, your file may not look exactly like this.  
 
Note that because the Postgresql package is inherited from the operating system distribution, and changes may occur in this file between revisions, your file may not look exactly like this.  
 
The new log_min_error_statement directive tells Postgresql to log the SQL statement that led to any error. The log_line_prefix directive adds a time stamp and the name of the database to every log record.
 
The new log_min_error_statement directive tells Postgresql to log the SQL statement that led to any error. The log_line_prefix directive adds a time stamp and the name of the database to every log record.
 +
===Postgresql log files===
 +
Postgresql log files are found at /var/opt/scalix/<instance>/postgres/data/pg_log:
 +
<pre>
 +
[root@goat pg_log]# pwd
 +
/var/opt/scalix/gt/postgres/data/pg_log
 +
[root@goat pg_log]# ls -l
 +
total 20
 +
-rw------- 1 postgres postgres 7355 Feb 27 10:55 postgresql-Fri.log
 +
-rw------- 1 postgres postgres    0 Feb 23 00:00 postgresql-Mon.log
 +
-rw------- 1 postgres postgres 1459 Feb 22 02:22 postgresql-Sun.log
 +
-rw------- 1 postgres postgres    0 Feb 26 00:00 postgresql-Thu.log
 +
-rw------- 1 postgres postgres    0 Feb 24 00:00 postgresql-Tue.log
 +
-rw------- 1 postgres postgres 4387 Feb 25 23:42 postgresql-Wed.log
 +
</pre>

Revision as of 04:59, 20 March 2008

Diagnosing ScalixDB

Configure enhanced Postgresql logging

The default Postgresql error logging configuration is very terse. Errors are logged, but not time-stamped. The SQL statement that caused the error is not logged. This makes it hard to determine what caused a database error, or even when it happened. Edit the configuration file at /var/opt/scalix/<instance>/postgres/data/posgresql.conf, modifying the logging configuration as follows:

 					#   panic
 
 #log_error_verbosity = default		# terse, default, or verbose messages
 
-#log_min_error_statement = panic	# Values in order of increasing severity:
+log_min_error_statement = error	# Values in order of increasing severity:
 				 	#   debug5
 					#   debug4
 					#   debug3
 					#   debug2
@@ -294,9 +294,9 @@
 #debug_pretty_print = off
 #log_connections = off
 #log_disconnections = off
 #log_duration = off
-#log_line_prefix = ''			# Special values:
+log_line_prefix = '%d %m '			# Special values:
 					#   %u = user name
 					#   %d = database name
 					#   %r = remote host and port
 					#   %h = remote host

Note that because the Postgresql package is inherited from the operating system distribution, and changes may occur in this file between revisions, your file may not look exactly like this. The new log_min_error_statement directive tells Postgresql to log the SQL statement that led to any error. The log_line_prefix directive adds a time stamp and the name of the database to every log record.

Postgresql log files

Postgresql log files are found at /var/opt/scalix/<instance>/postgres/data/pg_log:

[root@goat pg_log]# pwd
/var/opt/scalix/gt/postgres/data/pg_log
[root@goat pg_log]# ls -l
total 20
-rw------- 1 postgres postgres 7355 Feb 27 10:55 postgresql-Fri.log
-rw------- 1 postgres postgres    0 Feb 23 00:00 postgresql-Mon.log
-rw------- 1 postgres postgres 1459 Feb 22 02:22 postgresql-Sun.log
-rw------- 1 postgres postgres    0 Feb 26 00:00 postgresql-Thu.log
-rw------- 1 postgres postgres    0 Feb 24 00:00 postgresql-Tue.log
-rw------- 1 postgres postgres 4387 Feb 25 23:42 postgresql-Wed.log