- 🇺🇸United States jamesgrobertson
I'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!
- 🇫🇷France musa.thomas France 🇫🇷
@jamesgrobertson why u need hook_alter inside event ..... strange.... just use the event
- Status changed to Needs review
over 1 year ago 1:52pm 11 April 2023 - 🇦🇹Austria arthur_lorenz Vienna
I extended patch #5 enable the users to create their own message format providing more metadata.
- 🇦🇹Austria arthur_lorenz Vienna
I added a new config to enable/disable a check if the selected log group or stream is valid.
- Status changed to Needs work
over 1 year ago 10:16am 12 April 2023 - 🇦🇹Austria fago Vienna
thx. 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
+/** + * Event to use + * + * @SuppressWarnings(PHPMD.CamelCaseParameterName) + * @SuppressWarnings(PHPMD.CamelCaseVariableName) + */ +class AwsCloudwatchLogsSendEvent extends Event { + + protected $message; + + protected $logGroup; + + protected $logStream; + + protected $context; +
- 🇦🇹Austria arthur_lorenz Vienna
Thx, cleaned up the code and fixed cs issues.
- Status changed to Needs review
over 1 year ago 9:15am 26 April 2023 - 🇷🇴Romania aludescher
The 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():
Support for keys without a placeholder prefix is deprecated in Drupal 9.1.0 and will be removed in Drupal 10.0.0.
Fix: filter the $context parameter before creating a FormattableMarkup message.
- Merge request !2Issue #3276441: Add feature sending drupal log to aws cloudwatch → (Closed) created by jamesgrobertson
- 🇺🇸United States jamesgrobertson
In #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.
- Status changed to RTBC
8 months ago 12:26pm 21 March 2024 - 🇸🇮Slovenia useernamee Ljubljana
@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:
diff -u b/src/Logger/Log.php b/src/Logger/Log.php --- b/src/Logger/Log.php +++ b/src/Logger/Log.php @@ -179,7 +183,16 @@ $this->putLog->putLog( $aws_client, - $message_formatted, + $event->getMessage(), $event->getLogGroup(), $event->getLogStream() );
This code is already running on system so I'm marking this ticket RTBC.
- 🇫🇷France musa.thomas France 🇫🇷
glad to see new maintener and this feature will be released !
- e8cbae7c committed on 8.x-1.x
Issue #3276441 by jamesgrobertson, arthur_lorenz, Musa.thomas,...
- e8cbae7c committed on 8.x-1.x
- Status changed to Fixed
8 months ago 2:14pm 21 March 2024 - 54b47da0 committed on 8.x-1.x
Issue #3276441 by jamesgrobertson, arthur_lorenz, Musa.thomas,...
- 54b47da0 committed on 8.x-1.x
Automatically closed - issue fixed for 2 weeks with no activity.