Class: Tina4::Log::HeaderlessLogDevice

Inherits:
Logger::LogDevice
  • Object
show all
Defined in:
lib/tina4/log.rb

Overview

A log device that writes ONLY log lines.

stdlib ::Logger stamps a banner as the FIRST LINE of every file it creates — and it creates one on every rotation too:

# Logfile created on 2026-08-01 21:49:10 +0200 by logger.rb/v1.7.0

In JSON mode (TINA4_LOG_FORMAT=json) that is not JSON, so any line-oriented shipper — Filebeat, Fluent Bit, Vector, promtail, jq -c — fails on line 1 of every file and every rotated file. It is a Ruby-only artifact: no other Tina4 framework emits it, so a JSON pipeline that works on Python/PHP/Node breaks here and nowhere else.

Suppressing it in the DEVICE (rather than pre-creating the file) covers rotation as well, and keeps ::Logger's own rotation/locking untouched — add_log_header is the single method whose whole body is that banner.

Instance Method Summary collapse

Instance Method Details

#add_log_header(file) ⇒ Object



81
# File 'lib/tina4/log.rb', line 81

def add_log_header(file); end