mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #83] use platform end of line for lineformatter #27
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @laurentopprecht on GitHub (May 4, 2012).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/83
Improvement
class LineFormatter implements FormatterInterface
{
const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
replaces by
class LineFormatter implements FormatterInterface
{
const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%" . PHP_EOL;
so that it works better on Windows where end of line is /r/n.
@Seldaek commented on GitHub (May 5, 2012):
I'm really not sure whether this would be a good thing. This would make the log files platform dependent, which isn't great. In theory most apps should handle all line endings equally well, but in practice this is not the case, so I would say having a unique format across all platform as the default is better. Anyway this is indeed the default, and you are free to use a custom format in your application if you'd rather have different line endings.
Anyway, I wonder what issues you experienced on windows? If it's about opening log files with notepad, I would highly suggest you install Notepad2 - if you pick the "Setup" version it will replace windows' default Notepad by this one which is really superior in all ways.