Up

Module File_tail

Signature

module Error : sig .. end
module Warning : sig .. end
module Update : sig .. end
val create : ?read_buf_len:int -> ?read_delay:Core.Std.Time.Span.t -> ?retry_null_reads:bool -> ?break_on_lines:bool -> ?ignore_inode_change:bool -> ?start_at:[
| `Beginning
| `End
| `Pos of Core.Std.Int64.t
] -> ?eof_latency_tolerance:Core.Std.Time.Span.t -> ?null_read_tolerance:Core.Std.Time.Span.t -> string -> Update.t Import.Pipe.Reader.t

create file creates a File_tail.t that will immediately begin reading file, and then will start the stat-read loop.

read_buf_len sets the size of the internal buffer used for making read system calls.

read_delay sets how long the stat-read loop waits each time after it reaches eof before stat'ing again. Setting read_delay too low could cause unecessary load.

If retry_null_reads = true, then reads that return data with null ('\000') characters are ignored and cause the system to delay 0.2s and attempt the read again. If retry_null_reads = false, then the file tail will process data with nulls just as it would any other data.

If break_on_lines = true, the file tail will break data into lines on '\n'. If not, the fill tail will return chunks of data from the end of the file as they are available.

If ignore_inode_change = true, the file tail will silently press on when the file's inode changes. If not, an inode change will cause the file tail to report an error and stop. CIFS changes inodes of mounted files few times a day and we need ignore_inode_change = true option to keep tailers watching files on it alive.

start_at determines the file position at which the file tail starts.

eof_latency_tolerance affects the Did_not_reach_eof_for warning.

null_read_tolerance determines how long the tailing must observe null reads before it will report a Delayed_due_to_null_reads_for warning.