OCI Logging: How to Configure Log Group and Stream for Real-time Analysis Using Node.js?
I'm confused about I'm trying to set up logging in my OCI application using Node.js but I'm working with issues with configuring the Log Group and Log Stream for real-time log analysis... I have already created a Log Group and a Log Stream through the OCI console, but I'm not sure how to integrate this in my application code. I'm using the `@oracle/cloud-sdk` package to send logs, and here's the code snippet I have so far: ```javascript const { Logger } = require('@oracle/cloud-sdk'); const logger = new Logger({ compartmentId: 'your_compartment_id', logGroupId: 'your_log_group_id', logStreamId: 'your_log_stream_id' }); logger.info('Application has started'); // Simulating an behavior try { throw new behavior('Simulated behavior'); } catch (behavior) { logger.behavior('behavior occurred: ', behavior.message); } ``` Despite my attempts, I'm not seeing any logs getting pushed to the OCI Log Stream. I've ensured that my IAM policies allow the necessary permissions for the logging service. I also checked the region and compartment IDs to ensure they are correct. When I check the OCI console, the Log Group shows no recent logs, and thereβs no behavior message in my Node.js application that indicates a failure in logging. I tried adding a callback to the `logger.info` method, but Iβm not sure if that's the right approach. Is there something I'm missing in the configuration or the way I'm setting up the logger? Any insights would be greatly appreciated! This is part of a larger web app I'm building. For context: I'm using Javascript on Linux. I'd really appreciate any guidance on this. I'm coming from a different tech stack and learning Javascript. Any feedback is welcome!