Closed davidfuhr closed 7 years ago
I know well logging and PSR3, but I really fail to see a valid use case for this logger here.
We use text files as data store for metrics.
So we utilize the logger to write our data files with the JsonFormatter and the ContextLogger.
What is the ContextLogger ?
The logger class introduced with this pull request.
I mean, I don't understand the point to write many lines like
{type}:{variable} [type:foobar, varible 10]
in a file.
The lines look like this
{"message":"measure:my.metric.name:3.8000","context":{"type":"measure","variable":"my.metric.name","value":"3.8000"},"level":100,"level_name":"DEBUG","channel":"metrics","datetime":{"date":"2015-11-11 00:00:01.312270","timezone_type":3,"timezone":"Europe\/Berlin"},"extra":[]}
We have another application that parses these files and exposes the data through an API for our Metrics Dashboard for consumption.
So, you replace the {type}
by the real type?
So why not logging directly the real type to avoid a useless overhead
As there is not feedback, I'm closing this PR.
The context logger makes use of the context array replacement feature defined in PSR-3. See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message for an example.
If you use monolog you should add the PsrLogMessageProcessor to your logger to enable replacement of the variables.