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

Fix monolog line formatter in logging cookbook example. #5656

Merged
merged 1 commit into from
Sep 5, 2015
Merged

Fix monolog line formatter in logging cookbook example. #5656

merged 1 commit into from
Sep 5, 2015

Conversation

vmarquezh
Copy link

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets

After Adding some extra Data in the Log Messages, logs were missing some detail (like missing translation tokens on translation.WARNING messages).

I've corrected the line formatter adding missing tokens taken from Monolog/Formatter/LineFormatter.php.

Example, log entries before adding extra data:

[2015-08-25 14:24:58] translation.WARNING: Translation not found. {"id":"GeoCountryReg.labels.imageFile1","domain":"messages","locale":"es"} []

And after:

[2015-08-25 14:27:29] [cutptr3q-f0d64b15] translation.WARNING: Translation not found.

Desired effect was:

[2015-08-25 14:36:18] [cutptr3q-3b0c7c83] translation.WARNING: Translation not found. {"id":"GeoCountryReg.labels.imageFile1","domain":"messages","locale":"es"} []

@xabbuh
Copy link
Member

xabbuh commented Aug 26, 2015

👍 looks good

@vmarquezh
Copy link
Author

Thank you @xabbuh

Is there anything else required from me? This is my 1st contribution and I am not sure.

@wouterj wouterj merged commit 6c6ed2a into symfony:2.3 Sep 5, 2015
wouterj added a commit that referenced this pull request Sep 5, 2015
…arquez)

This PR was merged into the 2.3 branch.

Discussion
----------

Fix monolog line formatter in logging cookbook example.

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

After [Adding some extra Data in the Log Messages](http://symfony.com/doc/current/cookbook/logging/monolog.html#adding-some-extra-data-in-the-log-messages), logs were missing some detail (like missing translation tokens on translation.WARNING messages).

I've corrected the line formatter adding missing tokens taken from [Monolog/Formatter/LineFormatter.php](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/LineFormatter.php).

Example, log entries before adding extra data:

```
[2015-08-25 14:24:58] translation.WARNING: Translation not found. {"id":"GeoCountryReg.labels.imageFile1","domain":"messages","locale":"es"} []
```

And after:

```
[2015-08-25 14:27:29] [cutptr3q-f0d64b15] translation.WARNING: Translation not found.
```

Desired effect was:

```
[2015-08-25 14:36:18] [cutptr3q-3b0c7c83] translation.WARNING: Translation not found. {"id":"GeoCountryReg.labels.imageFile1","domain":"messages","locale":"es"} []
```

Commits
-------

6c6ed2a Fix monolog line formatter in logging cookbook example.
@wouterj
Copy link
Member

wouterj commented Sep 5, 2015

Hi @vmarquezh!

After your PR has a "finished" label, you just have to wait till one of us has time to review & merge your PR.

I've merged your PR into the documentation now. Thank you for submitting it!

@vmarquezh
Copy link
Author

Thank you @wouterj @xabbuh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants