The 'watchdog show' command shows raw messages, variables need to be merged with the message before display.

Example output:

  Date              	Severity	Type  	Message                                   	User     
  ----              	--------	----  	-------                                   	----
  09/06/2008 - 01:14	error   	php   	%message in %file on line %line.          	Anonymous

Comments

mariuss’s picture

Just a side note, this issue is similar to one from another module: #303369: log message in email without variables

I guess both can be fixed the exact same way.

mariuss’s picture

Status: Active » Postponed (maintainer needs more info)

While creating a patch I realized that this issue is most likely fixed in the latest dev version. Will retest when the next version comes out.

mariuss’s picture

On a second thought, the way it was implemented has a problem. Since _dblog_format_message is used the t function is applied. To get rid of HTML tags (mostly em tags I guess), strip_tags is used. But this still leaves there encoded HTML entities.

If you have single quotes in your variables, and that's quite common with SQL statements for example, then they will show up pretty ugly.

One solution would be to use straight strtr, instead of _dblog_format_message/t + strip_tags. The only issue with strtr is that localization now is skipped. Not sure if localization is an issue in this case, it could be.

The proper solution would be to write a method similar to t, which is not calling either check_plain nor theme_placeholder, basically treats every variable as starting with '!'. Ideally such a function would live in Drupal core, or it could be implemented as an extra argument to t.

moshe weitzman’s picture

Status: Postponed (maintainer needs more info) » Fixed

committed the suggested solution.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.