All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.naviud.logtracker.actions.trackerproviders.UuidBasedTrackerIdFetcher Maven / Gradle / Ivy

Go to download

LogTracker is a logger module done for Play framework which prepends a unique UUID(tracker id) for the log messages that are generated for a particular request. Tracker id can be passed from a HTTP header or will be selected randomly when a request is initiated.

There is a newer version: 1.1.3
Show newest version
package io.github.naviud.logtracker.actions.trackerproviders;

import com.google.inject.Singleton;
import play.mvc.Http;

import static java.util.UUID.randomUUID;

/**
 * Implementation of TrackerIdFetcher for UUID based
 *
 */
@Singleton
public class UuidBasedTrackerIdFetcher extends TrackerIdFetcher {

    /**
     * Method to fetch the tracker id
     *
     * @return tracker id
     */
    @Override
    public String fetch(Http.Context ctx) {
        return randomUUID().toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy