Skip to content

Latest commit

 

History

History

examples

Examples

This package contains examples how to use logger.

configurationfile

Demonstrates how to use logger with configuration file.

It creates different loggers from the configuration file and writes messages on the console and to the file.

customasynclogger

Demonstrates how to create a new custom logger for the application.

It creates an async logger with provided queue size that writes messages on the console asynchronously. It also provides an example how to wait for all messages to be written.

customasyncstructuredlogger

Demonstrates how to create a new custom structured logger for the application.

It creates an async structured logger with provided queue size that writes messages on the console asynchronously. It also provides an example how to wait for all messages to be written.

customlogger

Demonstrates how to create a new custom logger for the application.

It creates a simple logger that writes messages on the console.

customstructuredlogger

Demonstrates how to create a new custom logger for the application.

It creates a simple logger that writes messages on the console in structured format.

defaultlogger

Demonstrates how to use default logger (root) without creating a new logger.

errorpanicwrappers

Demonstrates how to use error and panic wrappers.

jsonlogger

Demonstrates how to use default logger (root) that writes messages in JSON format.

keyvaluelogger

Demonstrates how to use default logger (root) that writes messages in key-value format.

logtofile

Demonstrates how to create a new custom logger that writes messages to the file.

structwrappers

Demonstrates how to use struct, http.Request, http.Response wrappers.