Simple logging service for sammler.
audit-log-service is a very simple logging service, which just acts as a temporary solution to get some logging up and running.
It logs to MongoDB and exposes some endpoints to create and to retrieve logs.
The solution was primarily created, because the ELK-stack just felt to heavy (> 1.5 GB RAM needed) for sammler.
audit-log-service can be configured by the following environment variables:
General:
PORT
- The port to run the REST API (defaults to3004
).
MongoDB:
MONGODB_DEBUG
- Whether to use the Mongoose debug mode or not, defaults tofalse
.MONGODB_HOST
- MongoDB host, defaults tolocalhost
.MONGODB_PORT
- MongoDB port, defaults to27017
.MONGODB_DATABASE
- MongoDB database, defaults tosammlerio
.
NATS-STREAMING:
NATS_STREAMING_HOST
NATS_STREAMING_PORT
The functionality of audit-log-service is documented in a swagger file, available at http://localhost:3004/api-docs when running the image.
Alternatively api-docs is also available here.
Run
$ npm run dc-dev-up
Which will spin up a MongoDB instance at port 27018 (to prevent conflicts with the default port).
Then run the tests:
$ npm run test
Stefan Walther
MIT