Skip to content

EPIC: logging improvements #27

@paasovaara

Description

@paasovaara

Currently both transitlog-server and ui (express server) do very little logging. This makes troubleshooting quite difficult, specially during the deployment phase (but also during production)

Conventions used in other stacks (at least Transitdata):

  • output to System-out, which Docker swarm will redirect to correct place
  • output format: json. F.ex Bessersmith users https://github.com/trentm/node-bunyan for logging, perhaps use the same?

example log output (you can add more fields but perhaps consider using the same naming conventions?)

{
  "timestamp":"2019-05-14T11:43:23.764Z",
  "level":"INFO", # or: ERROR, WARN 
  "message":"your message here"}

For server side logging it would make sense to perhaps log all the requests with these information (if possible):

  • endpoint invoked (and since we're using graphql it could make sense to add some part of the payload?)
  • timestamp
  • HTTP result code
  • time elapsed to process the request?
  • possible other app level info if useful

for example more fields?

{
  "http-result":200,
  "processing-time":120  # ms
}

Also please add detailed logging specially in the beginning of the app (f.ex possible connection errors to db, etc) and also some message if server is shut down, etc?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions