I run a couple of nodejs APPS in cloud foundry on IBM cloud. I wanted to integrate all this in logDNA so I setup a logDNA instance.
1 - I did NOT configure any source as is described in the help (adding agents etc). Still logs started to appear from my cloudant services and my nodejs Apps. System logs apparently. Wondering why... Is the agent by default in the buildpack or something like this?
2 - Now I also wanted to add nodejs APP logs. So I followed: https://github.com/logdna/nodejs and added the following code in my app:
var Logger = require('logdna');
var options = {
//hostname: ,
//logdna_url: "https://logs.eu-de.logging.cloud.ibm.com",
//mac: macAddress,
//env: "Development"
};
const apikey = "MY KEY"; //my REAL key ;-)
var logger = Logger.createLogger(apikey, options);
logger.log('Starting APP');
But I never got any APP logs in the logdna instance. Only the platform logs. I tried many different options, never got it to work.
Any idea anyone?
So this is how it works now: - I only configured the "configure platform logs" in the GUI. - I did not add a CUPS instance. I tried it (as described in the docs by provisionning a syslog port) but it did not bring anything new, I actually started to get a log of rubbish logs.... SO I removed that CUPS instance. Not too sure what this is for.
--> I am getting the platform logs, and I also see any console.log entries.
I then also finally got logDNA nodejs package to work. The culprit was the lodDNA URL as @Milan pointed out. I had tried several, but the one that worked in the end was: logdna_url: "https://logs.eu-de.logging.cloud.ibm.com/logs/ingest"