new module: mod_log_json
I just committed mod_log_json to trunk in r1829898.
Right now, to use it you need something like this:
LogFormat "%^JS" json
CustomLog "logs/access_log.json" json
Currently it has a static format of the JSON, and example message is like this:
Some changes I'd like to figure out:
- Right now mod_log_json is a format string to mod_log_config -- this
is mostly to be able to leverage mod_log_config's support to write to
many outputs (files, buffered logs, pipes, programs, etc).
- Leveraging the existing mod_log_config format strings. Exposing the
internal hash of callbacks isn't that hard, I experimented with adding
a hook of that here
but a bigger refactoring is needed to expose mod_log_config's parsing
of the format strings, rather than just their key-names.
- mod_log_json is not configurable right now, the format is static.
Obviously, being able to configure what is logged, what headers, etc
is valuable. I played with some options here, but wasn't happy with
it. Any ideas?
- (small) I'd like to be able to log in RFC-3339 timestamps, in
JSON-world this seems like the most common format by far. Just need
to do the work to export an apr_time_t that way, I don't think there
is existing code for that?