abumq / residue-java

Official Java client library to interact with residue logging server seamlessly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Residue Java Client

Version GitHub license

Introduction

This library provides you interface to connect to the residue seamlessly and use it as your central logging library.

Please note, until first stable release we are not providing JAR file for this library. Please feel free to import the relevant code in to your library.

For regular java project you will need Residue.java and Base64.java

For android project you will also need ResidueConnectTask.java

Dependencies

Download Dependencies

mkdir lib
wget https://abumq.github.io/downloads/bcprov-jdk15on-156.jar -O lib/bcprov-jdk15on-156.jar ## BouncyCastle
wget https://abumq.github.io/downloads/gson-2.6.2.jar -O lib/gson-2.6.2.jar ## GSON

Higher security

You may be interested in Unlimited Strength Jurisdiction Policy Files for higher security and ability to use AES-256 cryptography. Please make sure you read the policy statement.

You can download it from here and make sure you unzip these files to <java-home>/jre/lib/security (please make backups as required).

Official Links

Compiling

All the following commands should be run from the root directory.

Compile Library

mkdir bin
sh compile-lib.sh

Compile & Running The Sample Application

sh compile-and-run-sample.sh

Usage

Residue r = Residue.getInstance();
r.loadConfigurations("config.json");
r.reconnect();

Residue.Logger logger = Residue.getInstance().getLogger("default");

logger.info("info log");
logger.verbose(3, "verbose level 3 log");

// you can set System.out print stream

Residue.getInstance().setDefaultLoggerId("sample-app");
System.setOut(Residue.getInstance().getPrintStream());

// all of these calls will send to residue
System.out.println("this is %s", "message");
System.out.println(true);

Samples

Check out simple sample or Android sample

License

Copyright 2017-present @abumq (Majid Q.)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Official Java client library to interact with residue logging server seamlessly.

License:Other


Languages

Language:Java 99.6%Language:Shell 0.4%