Logging Sucks

Logging sucks. And here’s how to make it better. by Boris Tane 2024-12-20T03:14:22.847Z INFO HttpServer started successfully binding=0.0.0.0:3000 pid=28471 env=production version=2.4.1 node_env=production cluster_mode=enabled workers=4 2024-12-20T03:14:22.912Z debug PostgreSQL connection pool initialized host=db.internal:5432 database=main pool_size=20 ssl_mode=require idle_timeout=10000ms max_lifetime=1800000ms 2024-12-20T03:14:23.156Z INFO Incoming request method=GET path=/api/v1/users/me ip=192.168.1.42 user_agent=”Mozilla/5.0″ request_id=req_8f7a2b3c trace_id=abc123def456 2024-12-20T03:14:23.201Z debug JWT token validation started issuer=auth.company.com audience=api.company.com exp=1703044800 iat=1703041200 sub=user_abc123 scope=”read write” 2024-12-20T03:14:23.445Z…

Read more on Hacker News