Appending Dump Files

When running FreeTDS™ with applications such as Apache™/PHP it is often difficult to get a usable log file. Since each of the many httpd children opens the file at the beginning of its connection and closes it on connection close, they tend to stomp all over each other. In append mode, the log file is opened for append each time it is written to and then immediately closed. If you are experiencing problems when running under Apache™ (or similar application) use append mode to generate useful logs.

Example 5.6. Turning on Dump File Append mode in freetds.conf

				[mssql]
				host = ntbox.mydomain.com
				port = 1433
				dump file = /tmp/freetds.log
				dump file append = yes
				

In this example, the /tmp/freetds.log file will contain log entries for all processes using the Microsoft SQL Server™ server, identified by pid.

[Important]Important

Because there will be one log file being opened and closed more or less continuously, there is going to be a negative impact on performance. Also, be advised that the log file will grow quite large.

As an alternative to FreeTDS™ logging, you might also consider using tcpdump or wireshark to log network packets. While not as useful as a TDS log, it can also help to identify problems.