Skip to content

Conversation

@AdamSolaris
Copy link

No description provided.

@mikehaertl
Copy link
Collaborator

@AdamSolaris Can you give me a use case? I want to avoid that our class here becomes sort of a template engine that does a lot of postprocessing. Even the replaceNewline parameter is already arguable. What is a "paragraph" in a log message?

@AdamSolaris
Copy link
Author

Hi. I am using yii2-streamlog to send logs in stderr, where it is picked up by logstash container. The problem is, that if log message has break paragraph characters, it's split into several messages for logstash, but I have to process these logs as a single solid message

@mikehaertl
Copy link
Collaborator

What do you mean paragraph characters? Isn't this just 2 newlines \n? In that case shouldn't replaceNewline help?

@AdamSolaris
Copy link
Author

I mean \r\n

@AdamSolaris
Copy link
Author

@mikehaertl
Copy link
Collaborator

As you usually have control over the messages you log (e.g. with Yii:info()), just don't put any \r in there. I never heard that \r\n represents a paragraph. It's rather the linebreak used on Windows systems. You should not use this in your code. If you want to represent a paragraph then use 2 linebreaks \n\n instead.

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

Successfully merging this pull request may close these issues.

2 participants