Log Format for Applications - project-sunbird/sunbird-devops GitHub Wiki
For Applications NOT running as Docker Containers:
Spec
Application logs need to Log as per RFC5424.
Run time requirements
Applications need to pipe their logs to SYSLOG. A separate process owned by the DevOps team will transport and aggregate the logs. Application Developers need to fill in the program
field intelligently, esp in clustered settings.
Sample Log line
Fields should be self explanatory. If not, refer to the RFC.
{
"message": "10.255.0.27 - - [02/Aug/2017:03:53:37 +0000] \"GET /auth/realms/sunbird/protocol/openid-connect/auth?client_id=portal&state=foo&redirect_uri=https%3A%2F%2Fdev.open-sunbird.org%2Fprivate%2Findex%3Fauth_callback%3D1&scope=openid&response_type=code HTTP/1.1\" 200 5927 \"-\" \"Go-http-client/1.1\" \"-\"\n",
"host": "10.0.7.9",
"priority": 14,
"timestamp8601": "2017-08-02T03:53:37Z",
"logsource": "15beacd7fa24",
"program": "proxy-dev_proxy.1.exsprsyjo6x7gfkj16bddos8t",
"pid": "114143",
"severity": 6,
"facility": 1,
"timestamp": "2017-08-02T03:53:37Z",
"facility_label": "user-level",
"severity_label": "Informational"
}
For Applications running as Docker Containers:
Follow instructions as in https://docs.docker.com/engine/admin/logging/view_container_logs/