Skip to content

Instantly share code, notes, and snippets.

@diyan
Last active April 8, 2018 02:27
Show Gist options
  • Save diyan/32269b77cd21df71ac766d3d7878cc5b to your computer and use it in GitHub Desktop.
Save diyan/32269b77cd21df71ac766d3d7878cc5b to your computer and use it in GitHub Desktop.
// Majority attributes are optional.
// The only required attributes are created_at, logger, level and either event + args or message.
{
"created_at": "2016-12-31T23:59:59Z",
"forwarded_at": "2017-01-01T00:00:00Z",
"logger": "foo.bar.baz.module",
"level": "INFO",
// V1. Classic, unstructured log event
"message": "OrderID '44444444-3333-2222-1111-000000000000' was not found",
// V2. Structured log event
"event": "order_not_found",
"args": {"order_id": "44444444-3333-2222-1111-000000000000"},
// Application-bound attributes
"app": {
"name": "ACME",
"env": "prod"
"build": "1.2.0.347",
"vcs_branch": "master",
"vcs_hash": "e69a2ab",
"extra": {
"arbitrary_key": "arbitrary_string_value"
}
}
// Host-bound attributes
"host": {
"name": "falcon",
"fqdn": "falcon.acme.com",
"ip_addr": "172.16.254.1",
"extra": {
"arbitrary_key": "arbitrary_string_value"
}
}
// Process-bound attributes
"process": {
"process_id": "1082",
"parent_process_id": "1081",
"process_name": "node"
"extra": {
"arbitrary_key": "arbitrary_string_value"
}
}
// Attributes that bound to the execution context
"context": {
// Cross-cutting attributes
"thread_id": "139939590087872",
"thread_name": "MainThread",
"correlation_id": "44444444-3333-2222-1111-000000000000",
// App-specific and well-known attributes
"company_id": " 44444444-3333-2222-1111-000000000000",
"order_id": "44444444-3333-2222-1111-000000000000",
"user_id": "44444444-3333-2222-1111-000000000000",
"extra": {
// App-specific but less-known attributes goes here
"arbitrary_key": "arbitrary_string_value",
"session_id": "44444444-3333-2222-1111-000000000000"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment