code-dot-org/dashboard — pull request #376 by geoffrey-elliott (2014-03-24 23:08:08+00:00)
Title: Stub in structured logging.

@laurelfan I've stubbed out a starting point for the structured logging I mentioned in the meeting today - we need this in Pegasus anyway and it solves the problem analytics gathering problem very simply. in short, anywhere in Dashboard you can now just do:

slog( field: 'value', other_field: 'other value' )

and this data, along with a src: 'dashboard', timestamp, and other environmental info would get entered into the structured data log (or dropped on the floor in development mode).

the data flows from a .log file in the machine to logentries where we can tag the items in the structured log (we can tell logentries it's JSON) to create counters, alerts, etc.

i have a separate checkin coming to website-ci that wires all of this up (it's not hard) but before i push all of that i wanted to make sure you were on board with the concept.

- Geoffrey

P.S. i imagine instrumentation in your case would be as simple as adding a few:

slog( tag: :lesson_started, lesson: 1, browser: browser_type )
slog( tag: :lesson_completed, lesson: 1, browser: browser_type )