Documentation ¶
Index ¶
- type BatchedFileWriter
- type Pruner
- type TargetFile
- func (streamFile *TargetFile) GetDir() (string, error)
- func (streamFile *TargetFile) GetFinalName(rotate components.RotateConfig) string
- func (streamFile *TargetFile) GetFinalPath(rotate components.RotateConfig) string
- func (streamFile *TargetFile) GetOriginalPath() string
- func (streamFile *TargetFile) GetSymlinkPath() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchedFileWriter ¶
type BatchedFileWriter struct {
// contains filtered or unexported fields
}
BatchedFileWriter is the file producer core.BatchedWriter implementation for the core.BatchedWriterAssembly
func NewBatchedFileWriter ¶
func NewBatchedFileWriter(file *os.File, compressOnClose bool, logger logrus.FieldLogger) BatchedFileWriter
NewBatchedFileWriter returns a BatchedFileWriter instance
func (*BatchedFileWriter) Close ¶
func (w *BatchedFileWriter) Close() error
Close is part of the Close interface and handle the file close or compression call
func (*BatchedFileWriter) IsAccessible ¶
func (w *BatchedFileWriter) IsAccessible() bool
IsAccessible is part of the BatchedWriter interface and check if the writer can access his file
func (*BatchedFileWriter) Name ¶
func (w *BatchedFileWriter) Name() string
Name is part of the BatchedWriter interface and wraps the file.Name() implementation
func (*BatchedFileWriter) Size ¶
func (w *BatchedFileWriter) Size() int64
Size is part of the BatchedWriter interface and wraps the file.Stat().Size() implementation
func (*BatchedFileWriter) Write ¶
func (w *BatchedFileWriter) Write(p []byte) (n int, err error)
Write is part of the BatchedWriter interface and wraps the file.Write() implementation
type Pruner ¶
type Pruner struct { Logger logrus.FieldLogger // Logger need to set // contains filtered or unexported fields }
Pruner file producer pruning component
Parameters ¶
- Prune/Count: this value removes old logfiles upon rotate so that only the given number of logfiles remain. Logfiles are located by the name defined by "File" and are pruned by date (followed by name). Set this value to "0" to disable pruning by count. By default this parameter is set to "0".
- Prune/AfterHours: This value removes old logfiles that are older than a given number of hours. Set this value to "0" to disable pruning by lifetime. By default this parameter is set to "0".
- Prune/TotalSizeMB: This value removes old logfiles upon rotate so that only the given number of MBs are used by logfiles. Logfiles are located by the name defined by "File" and are pruned by date (followed by name). Set this value to "0" to disable pruning by file size. By default this parameter is set to "0".
func (*Pruner) Configure ¶
func (pruner *Pruner) Configure(conf core.PluginConfigReader)
Configure initializes this object with values from a plugin config.
type TargetFile ¶
type TargetFile struct {
// contains filtered or unexported fields
}
TargetFile is a struct for file producer target files
func NewTargetFile ¶
func NewTargetFile(fileDir, fileName, fileExt string, permissions os.FileMode) TargetFile
NewTargetFile returns a new TargetFile instance
func (*TargetFile) GetDir ¶
func (streamFile *TargetFile) GetDir() (string, error)
GetDir create file directory if it not exists and returns the dir name
func (*TargetFile) GetFinalName ¶
func (streamFile *TargetFile) GetFinalName(rotate components.RotateConfig) string
GetFinalName returns the final file name with possible rotations
func (*TargetFile) GetFinalPath ¶
func (streamFile *TargetFile) GetFinalPath(rotate components.RotateConfig) string
GetFinalPath returns the final file path with possible rotations
func (*TargetFile) GetOriginalPath ¶
func (streamFile *TargetFile) GetOriginalPath() string
GetOriginalPath returns the base path from instantiation
func (*TargetFile) GetSymlinkPath ¶
func (streamFile *TargetFile) GetSymlinkPath() string
GetSymlinkPath returns a symlink path for the current file