I'm using loglevel to generate logs from the frontend of a js app and sending them to my api on another app with loglevel-plugin-remote. I haven't changed anything, but I'm no longer seeing the logs on my other app and I see the request to my api is stuck on pending in the network tab. here's my log setup:
import log from 'loglevel';
import remote from 'loglevel-plugin-remote';
// log.enableAll();
const customPlain = log => ({
message: log.message,
level: log.level.label,
stacktrace: log.stacktrace
})
remote.apply(log, {
method: 'POST',
level: 'debug',
format: customPlain,
url: process.env.LOG_API_ENDPOINT,
stacktrace: {
levels: ['debug', 'info', 'warn', 'error'],
depth: 4,
},
timestamp: () => new Date().toISOString(),
format: remote.plain
});
export default log;
in my frontend file I import log and just have these test logs.
log.warn('warn testing from the frontend')
log.error('error frontend');
log.debug('debug front');
log.info('info log')
this is my first time using loglevel but I've read through the docs and feel like my setup is okay. just not sure where to go from here. any advice or help is appreciated!