Documentation ¶
Overview ¶
Package log provides a persistence layer for json-formatted logs generated by the application.
It is intended to provide an out-of-the-box solution for storing and querying the logs, but should be replaced by more scalable solutions like ELK.
Index ¶
- Constants
- func BleveDeleteLogs(idx bleve.Index, str string) (int64, error)
- func BleveDuplicateIndex(from bleve.Index, inserts chan interface{}, logger func(string)) error
- func BleveListLogs(idx bleve.Index, str string, page int32, size int32) (chan log.ListLogResponse, error)
- func UnmarshallLogMsgFromFields(m map[string]interface{}, msg *log.LogMessage)
- type IndexableLog
- type MessageRepository
- type SyslogServer
- func (s *SyslogServer) AggregatedLogs(msgId string, timeRangeType string, refTime int32) (chan log.TimeRangeResponse, error)
- func (s *SyslogServer) Close()
- func (s *SyslogServer) DeleteLogs(query string) (int64, error)
- func (s *SyslogServer) ListLogs(str string, page, size int32) (chan log.ListLogResponse, error)
- func (s *SyslogServer) Open(indexPath string, mappingName string) error
- func (s *SyslogServer) PutLog(line *log.Log) error
- func (s *SyslogServer) Resync(logger *zap.Logger) error
- func (s *SyslogServer) Truncate(max int64, logger *zap.Logger) error
Constants ¶
const ( MinRotationSize = 68 * 1024 DefaultRotationSize = int64(200 * 1024 * 1024) )
Variables ¶
This section is empty.
Functions ¶
func BleveDeleteLogs ¶ added in v1.4.0
BleveDeleteLogs queries the bleve index, based on the passed query string and deletes the results
func BleveDuplicateIndex ¶ added in v1.5.0
func BleveListLogs ¶
func BleveListLogs(idx bleve.Index, str string, page int32, size int32) (chan log.ListLogResponse, error)
BleveListLogs queries the bleve index, based on the passed query string. It returns the results as a stream of log.ListLogResponse with the values of the indexed fields for each corresponding hit. Results are ordered by descending timestamp rather than by score.
func UnmarshallLogMsgFromFields ¶
func UnmarshallLogMsgFromFields(m map[string]interface{}, msg *log.LogMessage)
Types ¶
type IndexableLog ¶
type IndexableLog struct { Nano int log.LogMessage }
IndexableLog extends default log.LogMessage struct to add index specific methods
func MarshallLogMsg ¶
func MarshallLogMsg(line *log.Log) (*IndexableLog, error)
MarshallLogMsg creates an IndexableLog object and populates the inner LogMessage with known fields of the passed JSON line.
type MessageRepository ¶
type MessageRepository interface { PutLog(log2 *log.Log) error ListLogs(string, int32, int32) (chan log.ListLogResponse, error) DeleteLogs(string) (int64, error) AggregatedLogs(string, string, int32) (chan log.TimeRangeResponse, error) Resync(logger *zap.Logger) error Truncate(max int64, logger *zap.Logger) error }
MessageRepository exposes interface methods to manage the log messages provided by Pydio.
type SyslogServer ¶
type SyslogServer struct { SearchIndex bleve.IndexAlias // contains filtered or unexported fields }
SyslogServer is the syslog specific implementation of the Log server
func NewSyslogServer ¶
func NewSyslogServer(indexPath string, mappingName string, rotationSize int64) (*SyslogServer, error)
NewSyslogServer creates and configures a default Bleve instance to store technical logs Setting rotationSize to -1 fully disables rotation
func (*SyslogServer) AggregatedLogs ¶
func (s *SyslogServer) AggregatedLogs(msgId string, timeRangeType string, refTime int32) (chan log.TimeRangeResponse, error)
AggregatedLogs performs a faceted query in the syslog repository. UNIMPLEMENTED.
func (*SyslogServer) Close ¶ added in v1.5.0
func (s *SyslogServer) Close()
func (*SyslogServer) DeleteLogs ¶ added in v1.4.0
func (s *SyslogServer) DeleteLogs(query string) (int64, error)
DeleteLogs truncate logs based on a search query
func (*SyslogServer) ListLogs ¶
func (s *SyslogServer) ListLogs(str string, page, size int32) (chan log.ListLogResponse, error)
ListLogs performs a query in the bleve index, based on the passed query string. It returns results as a stream of log.ListLogResponse for each corresponding hit. Results are ordered by descending timestamp rather than by score.
func (*SyslogServer) PutLog ¶
func (s *SyslogServer) PutLog(line *log.Log) error
PutLog adds a new LogMessage in the syslog index.
Directories ¶
Path | Synopsis |
---|---|
Package grpc provides a Pydio GRPC service for querying the logs
|
Package grpc provides a Pydio GRPC service for querying the logs |
Package rest exposes a simple REST API for communicating with the GRPC package.
|
Package rest exposes a simple REST API for communicating with the GRPC package. |