Closed (fixed)
Project:
AWS Cloudwatch Logs
Version:
8.x-1.0
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2022 at 11:48 UTC
Updated:
4 Apr 2024 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
musa.thomasComment #3
musa.thomasComment #4
musa.thomaswrong patch sorry
Comment #5
musa.thomasSome fatal error is trigger on the seettings form when the aws client is not ready.
Add context of log message inside event.
Comment #6
musa.thomasComment #7
jamesgrobertson commentedI've added a hook to alter the messages before they get sent to CloudWatch. I had a need to add additional data to the message that wouldn't make sense to log to messages stored in the database. Feedback is welcome!
Comment #8
musa.thomas@jamesgrobertson why u need hook_alter inside event ..... strange.... just use the event
Comment #9
arthur_lorenz commentedI extended patch #5 enable the users to create their own message format providing more metadata.
Comment #10
arthur_lorenz commentedAdded the new config to the schema.
Comment #11
arthur_lorenz commentedI added a new config to enable/disable a check if the selected log group or stream is valid.
Comment #12
fagothx. the patch looks solid and is a critical feature I was expecting the module to already provide. let's get it added
When reviewing the code I found a small issue though, the following part needs some work on code comments to obey Drupal phpcs
Comment #13
arthur_lorenz commentedThx, cleaned up the code and fixed cs issues.
Comment #14
arthur_lorenz commentedComment #15
aludescher commentedThe sendAws() method tries to create FormattableMarkup messages using the entire $context parameter which sometimes contains keys without a placeholder prefix.
This results in the following error message: Invalid placeholder (%s) with string: "%s".
From \Drupal\Component\Render\FormattableMarkup::placeholderFormat():
Fix: filter the $context parameter before creating a FormattableMarkup message.
Comment #17
jamesgrobertson commentedIn #3276441-15: Add feature sending drupal log to aws cloudwatch the message couldn't be altered in the event. I've changed it so that the message that gets sent to CloudWatch is the one returned from the event.
Comment #18
useernamee commented@jamesgrobertson changes look good to me, except for the missing changes in the DeleteLogGroupForm which I plan to add manually.
@aludescher would you agree that we add this small change to your patch:
This code is already running on system so I'm marking this ticket RTBC.
Comment #19
musa.thomasglad to see new maintener and this feature will be released !
Comment #22
useernamee commentedmerged.