API page: http://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/functio...

The docs says:

> $link A link to associate with the message.

However when I look at the log list, I see a column called 'operations', and likewise a row on the individual log item page.

So I wonder: what does $link do, and how do I get something into 'operations'?

It turns out they're one and the same -- but this should be stated.

The link parameter is in fact no more special than the message parameter -- it's just a string that's stored. The intention is that you store a link to the thing concerned by the log item, but you could just as easily put 'whee!' or 'stop me and buy one' and that's what you get in the output. I'm guessing at some point the labelling was changed to 'operations' plural so you could put several links in. But the documentation should catch up (and perhaps the parameter name on D8 too).

Comments

jhodgdon’s picture

Status: Active » Closed (works as designed)

Hm. watchdog() doesn't do anything at all with the $link parameter itself. It just invokes hook_watchdog() and lets other modules do something to log the messages.

dblog.module stores $link in the 'link' field in the log table, and then when creating the report in dblog_overview(), as you have stated, takes the 'link' field and puts it into the column that is called Operations in the UI.

syslog.module just uses $link as part of what is stored in the system log, and has no UI to view the log that I am aware of.

So I don't think we should document that $link goes to Operations in watchdog(), since dblog.module is not the only option.

If you want to disagree, feel free to reopen. :)

joachim’s picture

Status: Closed (works as designed) » Active

Yup, I disagree ;)

My point is that it's unclear when looking at default Drupal how on the one hand the watchdog call and on the other hand the output at admin/reports/whatever join up.

jhodgdon’s picture

Well, it depends on which module you use for logging. Core has two. I don't think watchdog(), which is independent of the logging method, should document what the other modules do with the output, or in particular that it should pick one particular choice of module and document what it does.

Albert Volkman’s picture

Issue summary: View changes

Updated issue summary.

jhedstrom’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

Not sure if there is anything to be done here given https://www.drupal.org/node/2270941. If so, summary needs updating.

jhodgdon’s picture

Version: 8.0.x-dev » 7.x-dev

Well if anything it's Drupal 7, which has the same stated problem. As I stated above in #1 I do not think we should solve this. If someone thinks we should I would appreciate the response in the form of a patch, because I do not see a way to document this given #1. We have a link to hook_watchdog, which is what actually uses the parameters...

jhodgdon’s picture

Status: Active » Postponed (maintainer needs more info)