antikythera v0.4.0 AntikytheraEal.LogStorage.Behaviour behaviour View Source
Interface to work with storage of gear log files.
See AntikytheraEal
for common information about pluggable interfaces defined in antikythera.
Gear's log messages are written to a file in local filesystem (by AntikytheraCore.GearLog.Writer
).
Log files are then rotated after certain times and then uploaded to log storage.
Typically rotated log files are uploaded by a script that runs outside of antikythera,
in order to correctly upload logs even after ErlangVM crashes.
upload_rotated_logs/1
can also be used to upload logs to the storage, but this callback is
basically intended for on-demand (i.e. gear administrator initiated) uploads.
Link to this section Summary
Callbacks
Generates download URLs of multiple log files specified by list of keys.
Lists already-uploaded log files, whose last log messages are generated on the specified date, of a gear.
Upload all log files which have already been rotated but not yet uploaded.
Link to this section Callbacks
Specs
Generates download URLs of multiple log files specified by list of keys.
Keys can be obtained by list/2
.
Specs
list(gear_name :: Antikythera.GearName.t(), date_str :: String.t()) :: [ {String.t(), non_neg_integer()} ]
Lists already-uploaded log files, whose last log messages are generated on the specified date, of a gear.
date_str
is of the form of "20180101"
.
Returns list of pairs, where each pair consists of
- key which identifies the log file
- size of the log file
Specs
upload_rotated_logs(Antikythera.GearName.t()) :: :ok
Upload all log files which have already been rotated but not yet uploaded.