Eventum Logo

Eventum

Output

file

Output plugin that writes events to a local file with auto-reopen and rotation support.

Writes events to a local file. Automatically reopens the file if it is deleted or rotated, and closes the file handle after a period of inactivity to prevent handle leaks.

Parameters

ParameterTypeDefaultConstraintsDescription
pathpathRequiredOutput file path.
flush_intervalfloat1>= 0Seconds between buffer flushes.
cleanup_intervalfloat10>= 1.0Seconds of inactivity before the file handle is closed.
file_modeinteger6400–7777Unix file permissions (octal notation).
write_modestring"append""append" or "overwrite"Whether to append to or overwrite the file.
encodingstring"utf_8"Valid Python codec name.File encoding.
separatorstring"\n" (OS line separator)String inserted between events.
formatterformatterplainHow events are serialized before writing.

Behavior

  • Auto-reopen: If the output file is deleted or becomes inaccessible while the generator runs (e.g., by an external log rotator), the plugin automatically recreates and reopens it on the next write.
  • Auto-close: After cleanup_interval seconds with no writes, the file handle is closed to prevent resource leaks. It reopens automatically on the next write.
  • Write modes: append adds to the end of the file; overwrite truncates the file on each open.

Examples

Append JSON lines to a log file:

output:
  - file:
      path: output/events.jsonl
      formatter:
        format: json

Overwrite with pretty-printed JSON:

output:
  - file:
      path: output/latest.json
      write_mode: overwrite
      formatter:
        format: json
        indent: 2

Custom separator and permissions:

output:
  - file:
      path: /var/log/eventum/events.log
      file_mode: 644
      separator: "\n---\n"

On this page