Issue Report: LogDNA Browser Logging
Description
There is an issue with the logging mechanism in the LogDNA browser integration. The logs occasionally fail to capture the default context, including location, user information, environment, etc.
Example Log

LogDNA Initialization Code
const hostname = 'Tradeweb-User-Interface';
logdna.init(CONFIG.logDnaApiKey, {
app: `Tradeweb-User-Interface`,
env: CONFIG.env,
hostname: hostname,
enableStacktrace: true,
enableIpAddress: true,
console: CONFIG.logDnaEnabledLocally
});
if (CONFIG.logDnaEnabledLocally) {
console.log = (message, ...optionalParams) => logdna.log({ message: chalk.green(message, JSON.stringify(optionalParams)) });
console.error = (message, ...optionalParams) => logdna.error({ message: chalk.red(message, JSON.stringify(optionalParams)) });
console.debug = (message, ...optionalParams) => logdna.debug({ message: chalk.blue(message, JSON.stringify(optionalParams)) });
console.warn = (message, ...optionalParams) => logdna.warn({ message: chalk.yellow(message, JSON.stringify(optionalParams))});
console.info = (message, ...optionalParams) => logdna.info({ message: chalk.cyan(message, JSON.stringify(optionalParams))});
}
Automatically Added Context (from documentation)
"sessionId": "d1b69ea3-41c4-4b9b-85e2-32fb94cb219c",
"browser": {
"name": "chrome",
"version": "87.0.4280",
"os": "Mac OS",
"type": "browser"
},
"location": {
"ancestorOrigins": {},
"href": "https://your-web-app/home?q=1234567890",
"origin": "https://your-web-app",
"protocol": "https:",
"host": "your-web-app",
"hostname": "your-web-app",
"port": "",
"pathname": "/home",
"search": "?q=1234567890",
"hash": ""
}
Expected Behavior
The logs should consistently capture the default context, including location, user information, environment, etc.
Issue Report: LogDNA Browser Logging
Description
There is an issue with the logging mechanism in the LogDNA browser integration. The logs occasionally fail to capture the default context, including location, user information, environment, etc.
Example Log
LogDNA Initialization Code
Automatically Added Context (from documentation)
Expected Behavior
The logs should consistently capture the default context, including location, user information, environment, etc.