log

package
v4.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

README

Log Service

A simple implementation of a log repository that receives all log messages via gRPC and store them in a bleve repository.

REST API

TODO

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

This section is empty.

Variables

This section is empty.

Functions

func Migrate added in v4.0.1

func Migrate(f, t dao.DAO, dryRun bool, status chan dao.MigratorStatus) (map[string]int, error)

func NewDAO

func NewDAO(ctx context.Context, d dao.DAO) (dao.DAO, error)

Types

type BleveCodec

type BleveCodec struct {
	// contains filtered or unexported fields
}

func (*BleveCodec) BuildQuery

func (b *BleveCodec) BuildQuery(qu interface{}, offset, limit int32, sortFields string, sortDesc bool) (interface{}, interface{}, error)

func (*BleveCodec) GetModel

func (b *BleveCodec) GetModel(_ configx.Values) (interface{}, bool)

func (*BleveCodec) Marshal

func (b *BleveCodec) Marshal(input interface{}) (interface{}, error)

func (*BleveCodec) Unmarshal

func (b *BleveCodec) Unmarshal(indexed interface{}) (interface{}, error)

type IndexService

type IndexService struct {
	// contains filtered or unexported fields
}

func (*IndexService) AggregatedLogs

func (s *IndexService) AggregatedLogs(_ context.Context, _ string, _ string, _ int32) (chan log.TimeRangeResponse, error)

AggregatedLogs performs a faceted query in the syslog repository. UNIMPLEMENTED.

func (*IndexService) Close

func (s *IndexService) Close(ctx context.Context) error

func (*IndexService) DeleteLogs

func (s *IndexService) DeleteLogs(ctx context.Context, query string) (int64, error)

DeleteLogs truncate logs based on a search query

func (*IndexService) ListLogs

func (s *IndexService) ListLogs(ctx context.Context, str string, page int32, 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 (*IndexService) PutLog

func (s *IndexService) PutLog(ctx context.Context, line *log.Log) error

PutLog adds a new LogMessage in the syslog index.

func (*IndexService) Resync

func (s *IndexService) Resync(ctx context.Context, logger log2.ZapLogger) error

func (*IndexService) Truncate

func (s *IndexService) Truncate(ctx context.Context, max int64, logger log2.ZapLogger) error

type IndexableLog

type IndexableLog struct {
	Nano            int `bson:"nano"`
	*log.LogMessage `bson:"inline"`
}

IndexableLog extends default log.LogMessage struct to add index specific methods

func (*IndexableLog) BleveType

func (*IndexableLog) BleveType() string

BleveType is interpreted by bleve indexer as the mapping name

type MessageRepository

type MessageRepository interface {
	PutLog(context.Context, *log.Log) error
	ListLogs(context.Context, string, int32, int32) (chan log.ListLogResponse, error)
	DeleteLogs(context.Context, string) (int64, error)
	AggregatedLogs(context.Context, string, string, int32) (chan log.TimeRangeResponse, error)
	Close(context.Context) error
	Resync(context.Context, log2.ZapLogger) error
	Truncate(context.Context, int64, log2.ZapLogger) error
}

MessageRepository exposes interface methods to manage the log messages provided by Pydio.

func NewIndexService

func NewIndexService(dao dao.IndexDAO) (MessageRepository, error)

type MongoCodec

type MongoCodec struct {
	// contains filtered or unexported fields
}

func (*MongoCodec) BuildQuery

func (m *MongoCodec) BuildQuery(query interface{}, offset, limit int32, sortFields string, sortDesc bool) (interface{}, interface{}, error)

func (*MongoCodec) BuildQueryOptions

func (m *MongoCodec) BuildQueryOptions(query interface{}, offset, limit int32, sortFields string, sortDesc bool) (interface{}, error)

func (*MongoCodec) GetModel

func (m *MongoCodec) GetModel(sc configx.Values) (interface{}, bool)

func (*MongoCodec) Marshal

func (b *MongoCodec) Marshal(input interface{}) (interface{}, error)

func (*MongoCodec) Unmarshal

func (m *MongoCodec) Unmarshal(indexed interface{}) (interface{}, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL