jlog

Jefferson Lab logbook API

License

License

GroupId

GroupId

org.jlab
ArtifactId

ArtifactId

jlog
Last Version

Last Version

5.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

jlog
Jefferson Lab logbook API
Project URL

Project URL

https://github.com/JeffersonLab/jlog
Source Code Management

Source Code Management

https://github.com/JeffersonLab/jlog.git

Download jlog

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

jlog Java CI with Gradle Maven Central

The Jefferson Lab Java Logbook API for programmatic access to the logbook server.



Usage

The library is a single jar file with no dependencies other than the Java 8+ JVM and standard library. You can obtain the jar file from the Maven Central repository directly or from a Maven friendly build tool with the following coordinates (Gradle example shown):

implementation 'org.jlab:jlog:5.0.0'

You can check the Release Notes to see what has changed in each version.

API

Example

import org.jlab.jlog.LogEntry;
import org.jlab.jlog.exception.LogException;

public class HelloWorldDemo {
    public static void main(String[] args) throws LogException {
        LogEntry entry = new LogEntry("Hello World", "TLOG");
        
        long lognumber = entry.submitNow();
        
        System.out.println("Successfully submitted log entry number: " + lognumber);
    }
}

Configure

Properties

The default configuration properties are located in jlog-default.properties. You can override them by creating your own jlog.properties and including it in your home directory. Or you can programmatically set properties within a Java application using Library.setConfiguration().

Authentication

In order to interact with the logbook server users must authenticate. This is done using a logbook server client certificate, which is assumed to be located in the user's home directory in a file named .elogcert. You can override the location of the certificate with LogEntry.setClientCertificatePath().

Build

This Java 8+ project uses the Gradle 6 build tool to automatically download dependencies and build the project from source:

git clone https://github.com/JeffersonLab/jlog
cd jlog
gradlew build

Note: If you do not already have Gradle installed, it will be installed automatically by the wrapper script included in the source

Note: Jefferson Lab has an intercepting proxy

See Also

org.jlab

Jefferson Lab

Versions

Version
5.0.0