Logger Utility Elixir CLI
in Blog / Post / Elixir

Logger Tool Utility CLI
Introduction
I wanted a tool to filter and it could be extended as CLI tool, like other tools to install something but i decide to build one that have some of capabilities im looking to practice with elixir
Delevop
Ive started with
mix new <package_name> # This was like arbitrary at the beginning
and then starting with GenServer to parse files on logs, i want to have like an example to start with
2026-02-10 14:23:01.123 INFO [main] com.app.UserService - Application started successfully
2026-02-10 14:23:02.456 DEBUG [worker-1] com.app.Database - Connection pool initialized with 10 connections
2026-02-10 14:23:05.789 WARN [worker-2] com.app.Cache - Cache miss for key: user_session_abc123
2026-02-10 14:23:06.012 ERROR [worker-1] com.app.UserService - Failed to authenticate user: invalid credentials
2026-02-10 14:23:07.345 INFO [main] com.app.HttpServer - Listening on port 8080
2026-02-10 14:23:10.678 ERROR [worker-3] com.app.Database - Query timeout after 30000ms: SELECT * FROM users WHERE active = true
2026-02-10 14:23:15.901 WARN [worker-1] com.app.RateLimiter - Rate limit approaching for IP 192.168.1.50 (85/100)
2026-02-10 14:23:20.234 INFO [worker-2] com.app.UserService - User login successful: user_id=42
2026-02-10 14:23:25.567 ERROR [worker-1] com.app.Database - Connection refused: max pool size reached
2026-02-10 14:23:30.890 INFO [main] com.app.HealthCheck - Health check passed: all services operational
14:30:01.001 [info] Application MyApp.Web started successfully
14:30:02.123 [debug] Loading configuration from config/prod.exs
14:30:05.456 [warning] Deprecated function called: MyApp.Legacy.old_handler/2 (MyApp.Router)
14:30:06.789 [error] GenServer MyApp.Worker terminating: ** (RuntimeError) connection refused
14:30:10.012 [info] Processing request for /api/v2/users (MyApp.UserController)
14:30:15.345 [error] Task #PID<0.234.0> started from MyApp.Supervisor terminating (MyApp.TaskRunner)
14:30:20.678 [warning] Memory usage at 85% threshold (MyApp.Monitor)
14:30:25.901 [info] Cache invalidated for key: products_list (MyApp.Cache)
192.168.1.1 - - [10/Feb/2026:14:00:01 +0000] "GET /index.html HTTP/1.1" 200 3456 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
192.168.1.2 - admin [10/Feb/2026:14:00:02 +0000] "POST /api/login HTTP/1.1" 200 128 "http://example.com/login" "Mozilla/5.0"
10.0.0.5 - - [10/Feb/2026:14:00:05 +0000] "GET /api/users?page=2 HTTP/1.1" 200 4567 "-" "curl/7.68.0"
192.168.1.3 - - [10/Feb/2026:14:00:06 +0000] "GET /admin/dashboard HTTP/1.1" 403 89 "-" "Mozilla/5.0"
10.0.0.10 - - [10/Feb/2026:14:00:10 +0000] "POST /api/upload HTTP/1.1" 500 45 "-" "Python-urllib3/1.26.7"
192.168.1.1 - - [10/Feb/2026:14:00:15 +0000] "GET /static/app.js HTTP/1.1" 304 0 "http://example.com/" "Mozilla/5.0"
192.168.1.4 - - [10/Feb/2026:14:00:20 +0000] "DELETE /api/users/15 HTTP/1.1" 404 67 "-" "Postman/9.0"
::1 - - [10/Feb/2026:14:00:01 +0000] "GET /api/health HTTP/1.1" 200 15 "-" "axios/0.27.2"
::1 - - [10/Feb/2026:14:00:02 +0000] "POST /api/users HTTP/1.1" 201 234 "http://localhost:3000" "Mozilla/5.0"
::1 - - [10/Feb/2026:14:00:05 +0000] "GET /api/products HTTP/1.1" 200 5678 "-" "axios/0.27.2"
::1 - - [10/Feb/2026:14:00:06 +0000] "PUT /api/users/5 HTTP/1.1" 422 89 "http://localhost:3000" "Mozilla/5.0"
::1 - - [10/Feb/2026:14:00:10 +0000] "GET /api/orders HTTP/1.1" 500 34 "-" "axios/0.27.2"
::1 - - [10/Feb/2026:14:00:15 +0000] "GET /static/bundle.js HTTP/1.1" 304 0 "http://localhost:3000" "Mozilla/5.0"
2026-02-10 16:00:00.000 ERROR [worker-5] com.app.PaymentService - Payment gateway timeout after 5000ms
2026-02-10 16:00:01.000 INFO [main] com.app.HealthCheck - All good
192.168.1.99 - - [10/Feb/2026:16:00:02 +0000] "POST /api/checkout HTTP/1.1" 503 0 "-" "Mozilla/5.0"
2026-02-10 16:05:00.000 ERROR [worker-2] com.app.Database - Connection refused: max pool size reached
2026-02-10 16:05:01.000 ERROR [worker-4] com.app.Database - Connection refused: max pool size reached
2026-02-10 16:05:02.000 ERROR [worker-6] com.app.Database - Connection refused: max pool size reached
2026-02-10 16:05:03.000 ERROR [worker-1] com.app.UserService - Failed to authenticate user: invalid credentials
2026-02-10 16:05:04.000 ERROR [worker-3] com.app.UserService - Failed to authenticate user: invalid credentials
2026-02-10 16:10:00.000 ERROR [worker-2] com.app.Database - Query timeout after 15000ms: SELECT * FROM orders WHERE user_id = 99
2026-02-10 16:10:01.000 ERROR [worker-5] com.app.Database - Query timeout after 45000ms: SELECT * FROM products WHERE active = true
16:15:00.100 [error] GenServer MyApp.Worker terminating: ** (RuntimeError) connection refused
16:15:01.200 [error] GenServer MyApp.Worker terminating: ** (RuntimeError) connection refused
16:15:02.300 [error] GenServer MyApp.Worker terminating: ** (RuntimeError) connection refused
192.168.1.5 - - [10/Feb/2026:16:20:01 +0000] "POST /api/upload HTTP/1.1" 500 45 "-" "curl/7.68.0"
192.168.1.6 - - [10/Feb/2026:16:20:02 +0000] "POST /api/upload HTTP/1.1" 500 45 "-" "Python-urllib3/1.26.7"
192.168.1.7 - - [10/Feb/2026:16:20:03 +0000] "POST /api/upload HTTP/1.1" 500 45 "-" "Mozilla/5.0"
::1 - - [10/Feb/2026:16:20:04 +0000] "GET /api/orders HTTP/1.1" 500 34 "-" "axios/0.27.2"
::1 - - [10/Feb/2026:16:20:05 +0000] "GET /api/orders HTTP/1.1" 500 34 "-" "axios/0.27.2"
2026-02-10 14:23:01.123 INFO [main] com.app.UserService - Application started successfully
2026-02-10 14:23:01.123 INFO [main] com.app.UserService - Application started successfully
GenServer
i do want to learn more about sending and act call and cast for synchronous an asynchronous behaviors
starting with following commands one by one, LogTail to see what is on the file im looking for log, then maybe connect to external way to provision access or not, just for fun.
mix log.analyze
Analyze log files — combines search and stats into a quick overview.
mix log.export
Export parsed log entries to JSON or CSV.
mix log.report
Generate a self-contained HTML summary report from log files.
mix log.search
Search and filter log entries from files.
mix log.stats
Show summary statistics for log files.
mix log.tail
Watch a log file in real-time with parsed, color-coded, filtered output.
Conclusion
create tools with elixir was great. the package was published at Hex Package