public static boolean nowLoggingTo(String filename) {
        if (filename.contains("\n")) {
            throw new IllegalArgumentException("Cannot use filename with newline: "+filename);
        }
        long s = System.currentTimeMillis() / 1000;
        String meta = "" + s + " " + filename + "\n";
        byte[] data = meta.getBytes(UTF_8);
        try (OutputStream out = metaFile()) {
            out.write(data);
        } catch (java.io.IOException e) {
            System.err.println("Saving meta-data about logfile "+filename+" failed: "+e);
            return false;
        }
        return true;
    }
@author arnej

This class takes care of saving meta-data about a log-file,
ensuring that we can enact policies about log retention.
vespalog/src/main/java/com/yahoo/log/LogFileDb.java