Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging page edits #17

Open
issmirnov opened this issue Mar 19, 2016 · 2 comments
Open

Logging page edits #17

issmirnov opened this issue Mar 19, 2016 · 2 comments

Comments

@issmirnov
Copy link

Hello,

I wanted to ask if you would be open to a PR that implements logging of page edits (Action Mode: edit), in addition to page accesses (Action Mode: show).

My use case and rationale:

  • I'm trying to build a Kibana dashboard that will track edits by users. Since I'm interested specifically in the edit action, the access.log is not very helpful - I can attempt to create some convoluted grok rule that will check that the ref page has a ?do=edit suffix but it's pretty painful. In addition, if I were to use the grep trick for referring page, then I would trigger accesses to media such as CSS, the logo, and other payloads.
  • I can attempt to parse my nginx log directly, but I run into a similar issue with duplication of referral headers.
  • Therefore, it would be simplest and least painful to inject this functionality into this extremely useful logging plugin, since then I can hook into the various dokuwiki util functions, the admin UI config page, and the already tested logging mechanism. I can then pull this edit log and feed it into my scripts.

My proposed approach:

  • refactor action.php to contain methods logShowAction and logEditAction instead of logAccess. These will write to access.log and edit.log respectively.
  • call one of these two functions in the tail of logPageAccess, branching on $ACT

I would love any feedback or suggestions you may wish to deliver, and if all is well I'd be happy to implement this and send in a PR within a few days. I think with the rise of various monitoring solutions it would benefit people to have this convenient file that they can pull.

@micgro42
Copy link

Wouldn't it be easier to use the authorstats-plugin?

@issmirnov
Copy link
Author

No, this solves a different problem. There are various frameworks such as the ELK Stack and other log aggregators that have plugins well suited for sucking up Apache/Nginx formatted logs from text files.

The plugin you linked will only display that information on the wiki level, and will not write to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants