Skip to content

shivam21/RNLoggly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-loggly

React Native logger to push log to loggly v2

Installation

yarn add react-native-loggly@1.0.0

Usage

const logger = new LogglyTracker();
logger.setKey(LOGGLY_TOKEN);

Note: LOGGLY_TOKEN to be kept in secrets

logger.logData("Test Log");

Send Tags to Loggly

logger.log("tag", "Test Log");

Send Log Priority Level

logger.log("tag", "Test Log", LogLevel.WARN);

Available values for LogLevel:
DEBUG, WARN, ERROR, INFO

Send Failed Logs

logger.pushFailedLogs()

set Debug Mode

This will send log to loggly and console log in terminal logger.setIsDebug(true)

set App Name

app name will be prepend with tag logger.setAppName(appName)

set Logs Retention time

set failed logs rentention time dehaatLogger.setLogsRetention(24 * 60); Note: time to be input in minutes

Send CommonProperties with each log

logger.addAppProperty("lang", "user language");

Send User Properties

logger.addUserProperty("userId", userId);

About

React Native logger to push log to loggly

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors