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

[BUG] Logging is not sufficient... The $context parameters is not properly used when logging to PSR\Log\LoggerInterface #158

Open
jrglasgow opened this issue Jun 13, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jrglasgow
Copy link

What is the bug?

Logging is not sufficient... The $context parameters is not properly used when logging to PSR\Log\LoggerInterface

How can one reproduce the bug?

look at the logs that are produced

Request Success:
from
$this->log->info( 'Request Success:', array( 'method' => $request['http_method'], 'uri' => $uri, 'port' => $port, 'headers' => $request['headers'], 'HTTP code' => $response['status'], 'duration' => $response['transfer_stats']['total_time'], ) );

@jrglasgow jrglasgow added bug Something isn't working untriaged labels Jun 13, 2023
@shyim
Copy link
Collaborator

shyim commented Jun 13, 2023

It looks okay.

$this->log->info(
'Request Success:',
array(
'method' => $request['http_method'],
'uri' => $uri,
'port' => $port,
'headers' => $request['headers'],
'HTTP code' => $response['status'],
'duration' => $response['transfer_stats']['total_time'],
)
);

Which logger is in use?

@jrglasgow
Copy link
Author

Using the Drupal LoggerChannelInterface and after reading the standards I see that what I was looking for was for opensearch-php to provide placeholders that would bring he context data into the message string. Drupal's LoggerChannelInterface doesn't automatically bring the context in unless there are placeholders in the message... this might be considered a failing in Drupal's implementation of the PSR\Log\LoggerInterface.

I will look into getting Drupal modified to add the context when displaying out outputting the logs along with the message.

@wbeckler wbeckler added the good first issue Good for newcomers label Sep 19, 2023
@dblock dblock changed the title [BUG] [BUG] Logging is not sufficient... The $context parameters is not properly used when logging to PSR\Log\LoggerInterface Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants