Hey guys, I'm building erlog to try and solve problems with logging. While trying to add logs to my application, I couldn't find any lightweight log platform which was easy to set up without adding tons of dependencies to my code, or configuring 10,000 files.
ErLog is just a simple go web server which batch inserts json logs into an sqlite3 server. Through tuning sqlite3 and batching inserts, I find I can get around 8k log insertions/sec which is fast enough for small projects.
This is just an MVP, and I plan to add more features once I talk to users. If anyone has any problems with logging, feel free to leave a comment and I'd love to help you out.
I settled on a happy/ok midpoint recently whereby I dump logs in a redis queue using filebeat as it’s very simple. Then have a really simple queue consumer that dumps the logs into clickhouse using a schema Uber detailed (split keys and values), so queries can be pretty quick even over arbitrary fields. 30,00 logs an hour and I can normally search for anything in under a second.
Do you use any particular UI/Frontend tool for querying these logs?
I've also considered Grafana, but it's not good for viewing raw logs.
It’s probably incredibly boring to describe, but I think that’s why it just tends to work. The whole thing took an afternoon to write (in PHP of all things too).
The gist of it is:
- Structured logs (json) are stored as kv pairs in parallel arrays, along side metadata (host, timestamp, id, geo, namespace, etc).
- Log fields (ie kv pairs) are materialized (indexed) depending on query patterns, and vaccummed up if unused.
- Authoring queries and Kibana dashboard support is not trivial but handled with a query translation layer.
...so what you're saying they have to write "tail -F" instead of "tail".
> If you use grep you'll be doing the same expensive operation every time
if you have ingest that low it barely matters. Modern grep replacements are pretty fast
Try tools like Metabase and see how it makes your log reading far better.
https://www.elastic.co/guide/en/beats/filebeat/current/fileb...
https://vector.dev/docs/reference/vrl/
Free through '23 is my motto... Just a solo founder looking for feedback.
I have been beta testing it for a while for small scale (~50 million non-nested json objects) log aggregation it's working beautifully for this case.
It's a no nonsense solution that is seemless to integrate and operate. On the ops side, it's painless to setup, maintain, and push logs to. On the user side, its extremely fast and straight forward. End users are not fumbling their way through a monster UI like Kibana, access to information they need is straight forward and uncluttered.
I can't speak to it's suitability in a 1TB logs/day situation, but for a small scale straight forward log agg. tool I can't recommend it enough.
[1] https://log-store.com/
It uses SQLite internally but can parse log files in many formats on the fly. C++, BSD license, discussed 1 month ago: https://news.ycombinator.com/item?id=34243520
https://www.hetzner.com/cloud
More like $5 but still, 1 vCPU, 2GB RAM, 20GB NVMe storage. Closer to $4 USD if you let go of IPv4 in favor of IPv6 only.
Edit: Looks like that's also a shared vCPU.