katzgrau/KLogger

Support setting log line format

Closed this issue · 6 comments

Provide a way to set the format that a log line is written

@katzgrau What is your idea with this? I'm willing to help out but would like to have a pointer what it is that you're looking for :)

@richjenks is having a look, but in general, being able to supply a template for the log lines inside the file. It would give the user more flexibility to make the logs readable, machine readable, etc

// Example
$logger = new Katzgrau\KLogger\Logger('/var/log/', Psr\Log\LogLevel::WARNING, array (
    'format' => "[date]\t[level]\t[message]",
));

Cool, let me know if you'd like me to help out on it as well.

I don't want to start commenting on a closed issue, but perhaps we could include issue #35 in this issue in that case?

wdyt @katzgrau ?

(I would like to help out expand KLogger seeing as I make use of it on a daily basis, I wanna return the favor! 👍 )

Thanks!

Let's let @richjenks implement the shortcode-style of specifying a format, and then if you're interested, maybe implement a shortcode such as [json] to specify json output?

Can this be closed in light of #54?

Yep