Documentation
¶
Index ¶
Constants ¶
const ( LogSubDir = "logs" LLMLogFilePrefix = "llm" AppLogFilePrefix = "app" )
const DefaultLogRetentionDays = 30
DefaultLogRetentionDays is the default number of days to keep log files.
Variables ¶
This section is empty.
Functions ¶
func ListLogFiles ¶
ListLogFiles returns log file names matching the given prefix, sorted by date descending.
func NewLLMLogger ¶
NewLLMLogger creates a dedicated JSON logger for LLM request/response logging.
func SetRetentionDays ¶
func SetRetentionDays(days int)
SetRetentionDays configures how many days of log files to keep. Must be called before creating any DailyRotateWriter.
func SetupDefaultLogger ¶
SetupDefaultLogger configures the global slog logger to write to a daily-rotating file and stderr simultaneously.
Types ¶
type DailyRotateWriter ¶
type DailyRotateWriter struct {
// contains filtered or unexported fields
}
DailyRotateWriter writes log output to date-named files and rotates daily. File naming: {prefix}-{YYYY-MM-DD}.log
func NewDailyRotateWriter ¶
func NewDailyRotateWriter(dir, prefix string) (*DailyRotateWriter, error)
NewDailyRotateWriter creates a writer that rotates files daily under dir/LogSubDir/.
func (*DailyRotateWriter) Close ¶
func (w *DailyRotateWriter) Close() error
Close closes the current log file.