In my company we have two major systems, in a nutshell:
1 - receive data (xml or json) from 3rd party, do some internal processing, send data (xml or json) to another 3rd party.
2 - interface that employees & clients use to configure the things that have to do with that data.
I have to have good logs. For 3 reasons:
security, I need to be able to make sure no one is doing something they shouldn’t
cya, when one of the clients has an issue, I need to be able to prove it was data from one of the 3rd parties (or the clients themselves) and not our systems
simliar to cya, employees need to have an interface that they can see what clients are doing (takes some of the pressure off me to research the cya logs above)
In our existing (microsoft ecosystem on physical servers) systems, I have multiple database tables that I write to for logging purposes.
I’m curious how I should be doing this as we move the systems to AWS Lambdas.
(not sure what flair this should be, feel free to tell me to change it)
thanks!
Definitely start with logging to CloudWatch until you find some justification to switch to something else. It works out of the box with Lambda and the pricing is linear.
yeah, I’m writing to them now in my development and using the aws console > cloudwatch to read them but that’s not something that’s as easy as my writing an ad-hoc sql script, or having an interface the non-tech employees can read.
yeah, I’m writing to them now in my development and using the aws console > cloudwatch to read them but that’s not something that’s as easy as my writing an ad-hoc sql script, or having an interface the non-tech employees can read.
yeah, I’m writing to them now in my development and using the aws console > cloudwatch to read them but that’s not something that’s as easy as my writing an ad-hoc sql script, or having an interface the non-tech employees can read.
is there a better way to read CloudWatch logs?
I haven’t messed with the S3 yet (I’m VERY new to AWS (but not new to web dev, just been in the microsoft ecosystem the past 25+yrs))
Moving to AWS Lambdas for your systems sounds like a solid move. CloudWatch is definitely worth exploring for logging, but if you need more customization, rolling your own solution could complement it nicely. Just balance the built-in tools with what you need tailored.
Cloudwatch is preferably for application logging and debugging issues. Generally you don’t want to keep them longer than 30 days.
Your three reasons don’t seem like a good fit for cloudwatch. While you are talking about “logging” it is much more within the business domain tracking what actions were taking. While cloudwatch can do it, it is a bad fit.
Especially looking at the third reason. Showing data to employees is hard from cloudwatch.
Storing this data in databases can be a better fit. Sometimes you use other databases for it other than sql.
I don’t read log groups directly except for a specific use case. For any other log diving I use CW Insights, once you learn the query language it’s great and they added an AI helper so maybe the language is more accessible which would be great. I read log groups when I need to see the sequence of logs - like the info messages before an error. If you’re operating at scale getting to this point is bad news so it doesn’t happen often.
Cloudwatch is good once you get the hang of it. As is any logging and event system. Essentially like teaching someone a completely brand new version of SQL and table names and all that. The good news is you can probably create some really easy canned queries for your team to consume. And the interface is all there, you obviously need some security around it, but it saves you having to have another pane if glass on top of sql and you obviously don’t want them running sql directly.
It doesn’t sound like you need to expose this directly to a customer. You can export the results of the query. If you actually want them to directly query because they don’t trust you, that is a completely different matter and I wouldn’t go this route.
Also keep cost in mind and retention. Obviously you have a lot more in play than the raw cost. If this costs $50k more but saves you $150k/yr in dev time, still a win. Plus you maintain nothing. At all. You can sleep at night not worrying about redundancy and availability of logs and focus on things customers notice.
So from what I read, yes. But be really good about tagging everything. You are going to want to be able to easily query for things you want, your customer wants, etc. Without spending hours weeding out other garbage requests from bots, random debug or info level stuff that doesn’t matter, etc.
Just my two cents having come from a nightmare of a sql server home built logging system. Wow was that bad. And a lead that didn’t believe in relationships as well. Sooo bad.
You’re not going to be able to beat the UI you could build with a SQL database using CloudWatch Logs.
You can use CloudWatch Log Insights to search and filter records however you want, and if you log them in structured JSON format, you can get fairly close to just pulling out the records you want in the format you want, similar to how you’d do with SQL.
But I think the more direct use case it’s trying to solve is for technical users to do debugging and troubleshooting. You might find that continuing to use a SQL database is better for your use case.