Code Monkey home page Code Monkey logo

loggly-client's Introduction

loggly-client

v1.0.3

A Java library for posting log messages to Loggly, using Retrofit to interface with Loggly's REST API.

Quickstart

  1. Create a LogglyClient instance with your authorization token from Loggly.
final String LOGGLY_TOKEN = /* your token */;
final ILogglyClient loggly = new LogglyClient(LOGGLY_TOKEN);
  1. Log an event...
loggly.log("Hello world!");

API

setTags(String... tags)

Sets the Loggly tag(s) with variable arity strings (or with a CSV) to be applied to all subsequent log calls. Specify empty string to clear all tags.

loggly.setTags("foo", "bar");
// or equivalently:
loggly.setTags("foo,bar");

log(String message)

Logs a single event

loggly.log("hello world!");

log(String message, Callback callback)

Logs an event asynchronously

loggly.log("hello",
        new LogglyClient.Callback() {
            @Override
            public void success() {
                System.out.println("ok");
            }

            @Override
            public void failure(String error) {
                System.err.println("error: " + error);
            }
        });

logBulk(String... messages)

Note: In order to preserve event boundaries in a bulk upload, loggly-client replaces new-line characters ('\n') with carriage-returns ('\r'), which are subsequently stripped by Loggly.

Logs multiple events in bulk with variable arity strings

loggly.logBulk("event 1", "event 2");

logBulk(Collection<String> messages)

Logs multiple events in bulk with a Collection<String>

Collection<String> events = Arrays.asList("event 1", "event 2");
loggly.logBulk(events);

logBulk(Collection<String> messages, Callback callback)

Logs multiple events asynchronously in bulk with a Collection<String>

Collection<String> events = Arrays.asList("event 1", "event 2");
loggly.logBulk(events,
        new LogglyClient.Callback() {
            @Override
            public void success() {
                System.out.println("ok");
            }

            @Override
            public void failure(String error) {
                System.err.println("error: " + error);
            }
        });

Download

loggly-client-1.0.3.jar

Gradle

compile 'com.github.tony19:loggly-client:1.0.3'

Maven

<dependency>
  <groupId>com.github.tony19</groupId>
  <artifactId>loggly-client</artifactId>
  <version>1.0.3</version>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

loggly-client's People

Contributors

linakis avatar mend-for-github-com[bot] avatar tony19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loggly-client's Issues

Retrofit2 support?

Similar to loggly/timber-loggly#13, it looks like Retrofit 2 support is on master here but hasn't been released. Can you make a release? Or lmk what else you'd like to do before cutting a release, and I can take a look?

Update Maven Central Repository

Hi @tony19, Hope you are doing good!

The current production maven package contains the code different from the current Master branch code which hold HTTPS Loggly URL at line #32. This HTTPS URL is not in the hosted maven dependency so can you please update the maven central repo with the updated Master branch code? It's really urgent for us to get it done.

I've raised the PR to update GitHub readme to next 1.0.4 version of loggly-client repo. See PR #8. Also, the PR #16 for timber-loggly. Both of Those PR should merge before your new version deployment.

Thanks!

is this library maintained?

I want to be sure that I'm using the official loggly client for java,
the last commit was made in Dec 30, 2017
And that seems to long time without any update, or maybe there is another java client?

Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.