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

Phalcon Logger Interpolation does not work #16427

Closed
Jeckerson opened this issue Sep 9, 2023 Discussed in #16425 · 5 comments
Closed

Phalcon Logger Interpolation does not work #16427

Jeckerson opened this issue Sep 9, 2023 Discussed in #16425 · 5 comments
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@Jeckerson
Copy link
Member

Discussed in https://github.com/orgs/phalcon/discussions/16425

Originally posted by gnikolopoulos September 7, 2023
Hi all,

I am using the code from here in order to inject additional, dynamic data into my logging process while calling an external API, but I only get the placeholders themselves instead of the context values.

I am using Phalcon 5.2.1 and even tried the code on the example as is, to no avail.

@Jeckerson Jeckerson added the 5.0 The issues we want to solve in the 5.0 release label Sep 9, 2023
@niden niden added this to Phalcon v5 Sep 9, 2023
@niden niden moved this to In Progress in Phalcon v5 Sep 9, 2023
@niden niden added bug A bug report status: medium Medium labels Sep 9, 2023
@niden
Copy link
Member

niden commented Sep 11, 2023

@gnikolopoulos, @s-ohnishi

The interpolation works just fine. Have a look at this test:

https://github.com/niden/cphalcon/blob/T16427-logger-interpolation/tests/unit/Logger/Formatter/Line/FormatCest.php#L144

and this test:

https://github.com/niden/cphalcon/blob/T16427-logger-interpolation/tests/unit/Logger/Logger/LogCest.php#L184

However

The documentation is incorrect since it shows the use of the {name} vs %name%.

The logger interpolator placeholders are % and not {/}.

Apologies for that, I am fixing this now.

@niden
Copy link
Member

niden commented Sep 11, 2023

Right now there is no way that the placeholders for the interpolation in Logger/Formatter can be set. I will add that later on and let you guys know.

For now if you use % it will work.

Please check and let me know so that we can close this if all is OK.

@niden
Copy link
Member

niden commented Sep 11, 2023

I have updated the docs with the correct code.

@gnikolopoulos
Copy link

Right now there is no way that the placeholders for the interpolation in Logger/Formatter can be set. I will add that later on and let you guys know.

For now if you use % it will work.

Please check and let me know so that we can close this if all is OK.

I can confirm that using % works fine

@niden niden moved this from In Progress to Implemented in Phalcon v5 Sep 11, 2023
@niden
Copy link
Member

niden commented Sep 11, 2023

Thank you Giorgaki. Closing this one and will work on 16430 shortly

@niden niden closed this as completed Sep 11, 2023
@niden niden moved this from Implemented to Released in Phalcon v5 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Status: Released
Development

No branches or pull requests

3 participants