How runsystemid/golog works
Project type and purpose
• Golog is a Go library (an open-source logging tool), not a standalone service or web application.
• Its purpose is to provide a standardized, configurable logging façade for Runsystem services with two output streams (system log and TDR log), log rotation, and console-stdout toggling.
File structure
• Top-level Go files:
• loader.go – initializes the logging subsystem with a Config struct
• logger.go – exposes logging methods (Info, Error, Debug, Warn, Fatal, Panic)
• service.go – implements the actual writing/rotation of log entries to files
• model.go – defines the log message schema/structs (fields: traceId, srcIP, port, path, etc.)
• helper.go – context helpers to extract and attach metadata (traceId, srcIP, …)
• go.mod / go.sum – module dependencies
• README.md, CONTRIBUTING.md, LICENSE – documentation and governance
README for additional insights
• Configuration options: App, AppVer, Env, FileLocation, FileTDRLocation, FileMaxSize, FileMaxBackup, FileMaxAge, Stdout.
• Usage pattern:
• Call golog.Loader(config) once at startup.
• Invoke golog.Info(ctx, msg) or other levels anywhere thereafter.
• Two output channels: system log (all levels) and TDR log (special events).
Detail without overthinking
• Two logical sinks (system/TDR) even if they reuse the same service layer.
• Config fields that drive behavior (stdout toggle, file rotation).