Skip to content

Repository files navigation

logging-receiver

Server able to receive Python logging records via TCP socket connection.

  • collects log records from multiple processes or services
  • central point to collect logs
  • saves records to file in JSON Lines format
  • can rotate log files
  • can compress log files on rotation and use timestamp in file name
  • available as Docker container
  • other services (such as Elastic Stack) could pick up log files from this service

Install

Clone repository:

git clone https://github.com/matpackages/logging-receiver.git
cd logging-receiver

Copy example configuration and adjust config.json according to your needs:

cp example_config.json config.json

Make logs directory:

mkdir -p logs

Usage

Build image and start server:

docker build . -t logging-receiver
docker run --rm -v $PWD/logs:/app/logs -v $PWD/config.json:/app/config.json:ro -p 9000:9000 -it logging-receiver

Create some example logs using example client:

python3 client.py localhost 9000

The logs directory should get populated with log files.

References

Source code mostly taken from and inspired by:

About

Server able to receive Python logging records via TCP socket connection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages