October 23 2016

Firebird log execute SQL query

Tagged Under :

On Firebird it have a function to let you log the SQL Query where the system call. How to the log the Firebird SQL query?

First, you need install Firebird 2.5 or 3.0 server on your PC. After that, go to the Firebird folder find a file name call fbtrace.conf and then open the file with notepad.

At the end of the file you need to add the Database you want to trace and the configuration as below:
<database C:\firebirdDB\member.fdb>
	enabled true
	log_filename log/query.log
	log_statement_start true
</database>
You need to put full path of the Firebird Database directory which you want to trace the SQL query.

After finish the configuration, you may run the command to trace or log the SQL query.
fbtracemgr -se localhost:service_mgr -user sysdba -password masterkey -start -config "fbtrace.conf" > trace.log
If you are using Firebird 2.5 the fbtracemgr is on bin folder.
But if you use Firebird 3.0 it will be on same directory.

Note: if using windows 10, you need run the CMD as Administrator.

Make a Comment

You must be logged in to post a comment.