File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,28 @@ class Greet extends Handler {
5858}
5959```
6060
61+ ### Logging
62+
63+ To write output to the lambda's log stream, use * trace()* :
64+
65+ ``` php
66+ use com\amazon\aws\lambda\Handler;
67+
68+ class Greet extends Handler {
69+
70+ /** @return com.amazon.aws.lambda.Lambda|callable */
71+ public function target() {
72+ return function($event, $context) {
73+ $this->environment->trace('Invoked with ', $event);
74+
75+ return sprintf(/* Shortened for brevity */);
76+ };
77+ }
78+ }
79+ ```
80+
81+ Any non-string arguments passed will be converted to string using ` util.Objects::stringOf() ` .
82+
6183The lambda's environment accessible via * $this->environment* is an Environment instance, see [ below] ( https://github.com/xp-forge/lambda#environment ) .
6284
6385Development
You can’t perform that action at this time.
0 commit comments