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

Support setting log line format #39

Closed
katzgrau opened this issue Mar 5, 2015 · 6 comments
Closed

Support setting log line format #39

katzgrau opened this issue Mar 5, 2015 · 6 comments

Comments

@katzgrau
Copy link
Owner

katzgrau commented Mar 5, 2015

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

@onno-vos-dev
Copy link
Contributor

@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 :)

@katzgrau
Copy link
Owner Author

@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]",
));

@onno-vos-dev
Copy link
Contributor

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! 👍 )

@katzgrau
Copy link
Owner Author

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?

richjenks added a commit to richjenks/KLogger that referenced this issue Apr 16, 2015
katzgrau#39

1. Custom Formatting

Accomplished with the `logFormat` option which accepts a parametized string (see readme).

2. JSON output

The option `appendContext` was added which, when set to false, allows pure JSON output via the `logFormat` option (again, see readme).
@richjenks
Copy link
Contributor

Can this be closed in light of #54?

@katzgrau
Copy link
Owner Author

Yep

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

3 participants