-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PutLogEvents not showing in console #240
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
Comments
.WithTimestamp(time(nullptr)); you could just use DateTime::Now() Could you show me your log output? |
If I use DateTime::Now(), I get no known conversion for argument 1 from ‘Aws::Utils::DateTime’ to ‘long long int’, so I'm using DateTime::CurrentTimeMillis() instead. Turns out the problem was me, the CloudWatchLogs console filter was set after the logs and I wasn't seeing them because of that. I switched to the async version of PutLogEvents and now I am getting a segfault with the following stack trace: Program received signal SIGSEGV, Segmentation fault. |
It looks like segfaults are a common theme for you. Any chance you could send me your code so I can have a look at how everything is configured? |
I decided to write a minimal example, and it actually works. Running that same minimal example from my project fails, however, so it is certainly a problem with my setup. My minimal example is passing only constant values to the PutLogEvents request, so this feels like some sort of memory issue to me. However, valgrind reports tons of errors (such as the one below) even in my working example so it is hard to separate what is different. Is there a way to run this library in a valgrind-clean way? ==30342== Conditional jump or move depends on uninitialised value(s) |
I finally figured it out. There is no bug, I was just writing my async functions incorrectly. In my code I have helper functions for all of my aws calls, The helper function creates its own client object and then uses that to perform the request. For the async calls, the client object goes out of scope because it is a local variable, so bad things happen when the callback is invoked. Before I close this issue, I have a quick question: what is the recommended way of managing clients? I.e. should I use a separate client for each request or have a global client object for each service? |
To clarify, I often call the same request multiple times simultaneously, so my real question is whether a single client can handle this or must I instead create separate clients for each request. |
One client per service and configuration. The client is passed to your callbacks. Sent from my iPhone
|
Always only one client. Sent from my iPhone
|
Awesome, thanks! |
* Custom keychain support for macOS TLS (aws#204) * Update submodules and pull in keychain path override API PR Co-authored-by: Eero Kurimo <[email protected]>
I am calling PutLogEvents, and the log shows a successful request with status 200. However, the log events are not showing up in my aws console. I am making the call as follows:
The text was updated successfully, but these errors were encountered: