titan-x / titan

Messaging server with mobile and browser support.
MIT License
2 stars 3 forks source link

Use proper logging with log levels #2

Closed soygul closed 9 years ago

soygul commented 9 years ago

This is a good style guide on the subject (even though it's more about embedded systems than servers): https://source.android.com/source/code-style.html#log-sparingly

soygul commented 9 years ago

Solved by our new approach:

Only actionable events are logged (i.e. server started, client connected on IP ..., client disconnected, etc.). You can use logs as event sources. Anything else is considered telemetry and exposed with expvar. Queue lengths, active connection/request counts, performance metrics, etc. Metrics are exposed via HTTP at /debug/vars in JSON format.