sample/LogglyClientDemo.java
public static void main(String... args) {

        if (args.length == 0 || args[0].trim().isEmpty()) {
            System.err.println("missing argument: loggly token\nsee http://loggly.com/docs/customer-token-authentication-token/");
            System.exit(1);
        }

        final String TOKEN = args[0];
        final ILogglyClient loggly = new LogglyClient(TOKEN);

        System.out.println("posting single event to Loggly asynchronously...");
        loggly.log("Hello!\nThis is a\nmulti-line event!\n",
                new LogglyClient.Callback() {
                    public void success() {
                        System.out.println("callback succeeded");
                    }

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

        System.out.println("posting bulk events to Loggly asynchronously...");
        loggly.logBulk(Arrays.asList("E1", "E2"),
                new LogglyClient.Callback() {
                    public void success() {
                        System.out.println("bulk callback succeeded");
                    }

                    public void failure(String error) {
                        System.err.println("bulk callback failed: " + error);
                    }
                });

        System.out.println("posting single event to Loggly...");
        boolean ok = loggly.log("Hello!\nThis is a\nmulti-line event!\n");
        System.out.println(ok ? "ok" : "err");

        System.out.println("posting single JSON event to Loggly...");
        final String json = "{ \"timestamp\": \"2015-01-01T12:34:00Z\", \"message\": \"Event 100\", \"count\": 100 }";
        ok = loggly.log(json);
        System.out.println(ok ? "ok" : "err");

        System.out.println("posting bulk events to Loggly...");
        ok = loggly.logBulk("This is a\nmulti-line event 1", "Event 2", "Event 3");
        System.out.println(ok ? "ok" : "err");

        System.out.println("setting log tags to 'foo', 'bar', and 'baz'...");
        loggly.setTags("foo", "bar,baz");
        ok = loggly.log("This should be tagged with 'foo', 'bar', and 'baz'");
        System.out.println(ok ? "ok" : "err");
    }
public static void main(String... args) {

        if (args.length == 0 || args[0].trim().isEmpty()) {
            System.err.println("missing argument: loggly token\nsee http://loggly.com/docs/customer-token-authentication-token/");
            System.exit(1);
        }

        final String TOKEN = args[0];
        final ILogglyClient loggly = new LogglyClient(TOKEN);

        System.out.println("posting single event to Loggly asynchronously...");
        loggly.log("Hello!\nThis is a\nmulti-line event!\n",
                new LogglyClient.Callback() {
                    public void success() {
                        System.out.println("callback succeeded");
                    }

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

        System.out.println("posting bulk events to Loggly asynchronously...");
        loggly.logBulk(Arrays.asList("E1", "E2"),
                new LogglyClient.Callback() {
                    public void success() {
                        System.out.println("bulk callback succeeded");
                    }

                    public void failure(String error) {
                        System.err.println("bulk callback failed: " + error);
                    }
                });

        System.out.println("posting single event to Loggly...");
        boolean ok = loggly.log("Hello!\nThis is a\nmulti-line event!\n");
        System.out.println(ok ? "ok" : "err");

        System.out.println("posting single JSON event to Loggly...");
        final String json = "{ \"timestamp\": \"2015-01-01T12:34:00Z\", \"message\": \"Event 100\", \"count\": 100 }";
        ok = loggly.log(json);
        System.out.println(ok ? "ok" : "err");

        System.out.println("posting bulk events to Loggly...");
        ok = loggly.logBulk("This is a\nmulti-line event 1", "Event 2", "Event 3");
        System.out.println(ok ? "ok" : "err");

        System.out.println("setting log tags to 'foo', 'bar', and 'baz'...");
        loggly.setTags("foo", "bar,baz");
        ok = loggly.log("This should be tagged with 'foo', 'bar', and 'baz'");
        System.out.println(ok ? "ok" : "err");
    }
public static void main ( String ... args ) { if ( args . length == 0 || args [ 0 ] . trim ( ) . isEmpty ( ) ) { System . err . println ( "missing argument: loggly token\nsee http://loggly.com/docs/customer-token-authentication-token/" ) ; System . exit ( 1 ) ; } final String TOKEN = args [ 0 ] ; final ILogglyClient loggly = new LogglyClient ( TOKEN ) ; System . out . println ( "posting single event to Loggly asynchronously..." ) ; loggly . log ( "Hello!\nThis is a\nmulti-line event!\n" , new LogglyClient . Callback ( ) { public void success ( ) { System . out . println ( "callback succeeded" ) ; } public void failure ( String error ) { System . err . println ( "callback failed: " + error ) ; } } ) ; System . out . println ( "posting bulk events to Loggly asynchronously..." ) ; loggly . logBulk ( Arrays . asList ( "E1" , "E2" ) , new LogglyClient . Callback ( ) { public void success ( ) { System . out . println ( "bulk callback succeeded" ) ; } public void failure ( String error ) { System . err . println ( "bulk callback failed: " + error ) ; } } ) ; System . out . println ( "posting single event to Loggly..." ) ; boolean ok = loggly . log ( "Hello!\nThis is a\nmulti-line event!\n" ) ; System . out . println ( ok ? "ok" : "err" ) ; System . out . println ( "posting single JSON event to Loggly..." ) ; final String json = "{ \"timestamp\": \"2015-01-01T12:34:00Z\", \"message\": \"Event 100\", \"count\": 100 }" ; ok = loggly . log ( json ) ; System . out . println ( ok ? "ok" : "err" ) ; System . out . println ( "posting bulk events to Loggly..." ) ; ok = loggly . logBulk ( "This is a\nmulti-line event 1" , "Event 2" , "Event 3" ) ; System . out . println ( ok ? "ok" : "err" ) ; System . out . println ( "setting log tags to 'foo', 'bar', and 'baz'..." ) ; loggly . setTags ( "foo" , "bar,baz" ) ; ok = loggly . log ( "This should be tagged with 'foo', 'bar', and 'baz'" ) ; System . out . println ( ok ? "ok" : "err" ) ; }
Runs a demo of the Loggly client

@param args command-line arguments. The first and only argument
should be your Loggly customer token.
http://loggly.com/docs/customer-token-authentication-token/
Runs a demo of the Loggly client