Posts

Showing posts from July, 2023

AWS CloudWatch Check Logs of Lambdas

Image
While working in Microservices concept, you generally need to check CloudWatch logs in deep to identify the errors and debugging your code. So let's see how we can check logs insight of particular lambda. AWS CloudWatch - Education Funda Recent Logs For recent logs you can directly go into Lambda inside it monitor section. Lambda Logs Monitor Filter Logs Old Logs Insights Go down in Monitor logs and go to Recent Invocations section, on top right sight you can see 3 dots for action: Go in Logs Insight for Lambda Next screen will open like below in which you can run query and after that in graph you can select specific date and time logs very easily. Thanks for reading this blog, I hope it is helpful for you, please share your feedback in comments section guys. <> Happy Coding </> 💻

Connect with Oracle DB in Node JS

Image
Let's see how can we connect with oracle db in node js project or lambda Oracle DB - Education Funda First step is to install oracle db package with below command: ~ npm i  oracledb Let's see the code for connecting with oracle db for lambda handler: const oracledb = require ( "oracledb" ); oracledb . outFormat = oracledb . OUT_FORMAT_OBJECT ; exports . handler = async ( event , context , callback ) => { let connection ; const uatConnObj = { user : "db_user_name" , password : "db_pass" , connectString : "ip:port/db" , poolMax : 1 , poolMin : 0 , poolIncrement : 10 , }; const prodConnObj = { user : "db_user_name" , password : "db_pass" , connectString : "ip:port/db" , poolMax : 1 , poolMin : 0 , poolIncrement : 10 , }; try { await oracledb . createPool ( prodConnObj ); let dbPool = oracledb . getPool ();