Skip to content

Add replacing paragraph characters attribute - replaceParagraph#11

Open
AdamSolaris wants to merge 1 commit into
codemix:masterfrom
AdamSolaris:master
Open

Add replacing paragraph characters attribute - replaceParagraph#11
AdamSolaris wants to merge 1 commit into
codemix:masterfrom
AdamSolaris:master

Conversation

@AdamSolaris

Copy link
Copy Markdown

No description provided.

@mikehaertl

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@AdamSolaris

Copy link
Copy Markdown
Author

I mean \r\n

@AdamSolaris

Copy link
Copy Markdown
Author

@mikehaertl

Copy link
Copy Markdown
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