sql_log in 3.0.10

Alan DeKok aland at deployingradius.com
Fri Oct 9 14:58:12 CEST 2015

On Oct 9, 2015, at 8:49 AM, Wegener, Norbert <norbert.wegener at atos.net> wrote:
> Having used an ancient version of FR up to now I just look into 3.0.10. I started with a fresh install and activated sql in default, to get the functionality of the former sql_log module.
> Additionally I  enabled logfile in mods-available/sql and linked the file to mods-enabled.

  That's good.

>    # Write SQL queries to a logfile. This is potentially useful for tracing
>    # issues with authorization queries.
> logfile = ${logdir}/sqllog.sql


> I hope the following part of the logs are sufficient. I did not want to post 900 lines here. If necessary I can provide the complete log.

  No, that's fine.

> Firering up radtest with bob and hello, I get an Access-Accept.
> I would have expected to see a line in the logfile now, but no logfile is to be found and
> also in the post-auth part of the radius' debug output I do not see any anything that looks like writing to a file, instead:

  Hmm... the logs are written to that file for accounting packets, and for %{sql:...} expansions, and for the post_auth section.

> (0) # Executing section post-auth from file /home/dop/tests/freeradius-server-3.0.10/etc/raddb/sites-enabled/default^M
> (0)   post-auth {^M
> (0)     update {^M
> (0)       No attributes updated^M
> (0)     } # update = noop^M
> (0) sql: EXPAND .query^M


> The logfile will also not be written, when running radius in daemon mode.
> Do I have to change the config elsewhere for this ?

  No.  The code will have to be updated.

  In the mean time, you can can edit raddb/mods-config/main/mysql/queries.conf:

post-auth {
	# Write SQL queries to a logfile. This is potentially useful for bulk inserts
	# when used with the rlm_sql_null driver.
#	logfile = ${logdir}/post-auth.sql

  enable the "logfile" there, and it will work.

  Alan DeKok.

More information about the Freeradius-Users mailing list