loglevel-plugin-remote
loglevel-plugin-remote copied to clipboard
Working with papertrail
Hey @kutuluk thank you for this library, very easy to use. Wondering if you can help me with a quick issue.
I am using papertrail to receive the logs. After getting everything setup, I get the log events showing up on papertrail, but not the log message itself. The other weird thing, if I do log.warn("this is a warning"); It does show up, however if I do
log.warn("this is a warning");
log.error("this is a error");
Neither of those events show up on papertrail, only works if I do it one at a time. Below is my setup, not sure what I am missing, any help would be appreciated. Thanks!
const logDefaults = {
url: 'https://logs2.papertrailapp.com:[port]',
level: 'trace',
};
const loggerGlobal = log.noConflict();
const sender = remote.noConflict();
loggerGlobal.setDefaultLevel(0);
loggerGlobal.enableAll();
sender.apply(loggerGlobal, logDefaults);
Logging example.
loggerGlobal.log("Start search called B");
loggerGlobal.info('Log levels:');
And on papertrail, the messages don't show up, expect header information from the request.
Sep 29 06:39:55 76.28.217.64 logger Host: logs2.papertrailapp.com:[port]
Sep 29 06:39:55 76.28.217.64 logger Connection: keep-alive
Sep 29 06:39:55 76.28.217.64 logger Content-Length: 44
Sep 29 06:39:55 76.28.217.64 logger User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Sep 29 06:39:55 76.28.217.64 logger DNT: 1
Sep 29 06:39:55 76.28.217.64 logger Content-Type: text/plain
Sep 29 06:39:55 76.28.217.64 logger Accept: */*
Sep 29 06:39:55 76.28.217.64 logger Origin: [url]
Sep 29 06:39:55 76.28.217.64 logger Sec-Fetch-Site: cross-site
Sep 29 06:39:55 76.28.217.64 logger Sec-Fetch-Mode: cors
Sep 29 06:39:55 76.28.217.64 logger Sec-Fetch-Dest: empty
Sep 29 06:39:55 76.28.217.64 logger Referer: [url]
Sep 29 06:39:55 76.28.217.64 logger Accept-Encoding: gzip, deflate, br
Sep 29 06:39:55 76.28.217.64 logger Accept-Language: en-US,en;q=0.9