Skip to content

Latest commit

 

History

History
 
 

golang-logging

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Golang Logging

Logging example with plain-text and JSON logs.

Deploy

$ up

Usage

Tail the logs in one tab:

$ up logs -f

Hit the plain-text route a few times and you should see the logs.

$ curl `up url`/text/

Hit the json route to see how the JSON logs are translated to the internal format, allowing you to specify fields etc.

$ curl `up url`/json/

Notes

JSON logs need at least these fields:

  • level (string) – severity level
  • message (string) – log message

Optionally:

  • fields (object) – key/value pairs for contextual information