universal-loggly
v0.2.0
Published
loggly tool
Downloads
9
Readme
universal-loggly
feature
- send log to Loggly
how to install
- yarn add universal-loggly
include example
- vi /your-project/app.js
// for library
import { LogglyClient } from 'universal-loggly';
// you can custom myself helper
export function factoryLogglyClient() {
return new LogglyClient(`<loggly host>`, 'token', 'secret')
}
sample code
import { factoryLogglyClient } from 'universal-loggly-helper';
const logger = factoryLogglyClient();
const message = 'test message';
const redirectUrl = 'https://duckduckgo.com/';
const promise = logger.info(message, {
extend_content: true,
});
promise.then(function(data) {
// success
})
.catch(function(error) {
console.error(`[universal-loggly]: ${error}`);
})
.finally(function() {
window.location.href = redirectUrl;
});
plan of future
- storage cookie
- send hook