Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
loglevel-plugin-remote issue sending logs to my api

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!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda