Hey team i am trying to get normal logs
I am using NodeJs - Typescript
and using an nodejs agent from elastic to connect using server name and server token.
I want to capture general logs like below to be captured and reflect at kibana
console.log('This should log', randomNumber);
apm.logger.info(' Error from APM ', randomNumber1);
logger.info('Akhil- Working', randomNumber2);
to sent it to kibana using npm package like winston-elasticsearch, elastic-apm-node or elastic apm logger
my application has no rest api and thus i cant have transaction. And i want to capture the logs for clients and show the performance as well in future.
I tired to generate logs but the only logs being send to kibaana thrrough my nodejs application was
1. when doing rest api .. as it generated transaction ..
2. apm.CaptureError(new error ('some error occured'))
other then this both. I am not able to send the regular logs.
My end product is to give an end to end logs using elastic apm .. show it on dashboard and have those demographics with me so show the client everything is smooth. and capture error logs in case of error.